Skip to content

Conversation

@dolio
Copy link
Contributor

@dolio dolio commented Aug 12, 2025

The leaf mismatch is the innermost piece of the type that failed to match, but that can occur after the type has been pulled apart multiple times. The full type is the entry point to the subtyping check, and is more likely to correspond to an actual code value.

This fixes #5440. See the changed transcript output for a somewhat different example (where there the kinds made sense to talk about "a value" but there was actually no such value in the code). It might not be 100% guaranteed to never say something that sounds like a kind error, but it's less likely.

One thing I'm not sure about is if you have a really big subtyping call, it might be hard to spot the actual difference in the full types. So maybe I should still include the leaf mismatch with different verbage?

The leaf mismatch is the innermost piece of the type that failed to
match, but that can occur after the type has been pulled apart
multiple times. The full type is the entry point to the subtyping
check, and is more likely to correspond to an actual code value.
@dolio dolio requested review from aryairani and pchiusano August 12, 2025 20:06
@aryairani
Copy link
Contributor

One thing I'm not sure about is if you have a really big subtyping call, it might be hard to spot the actual difference in the full types. So maybe I should still include the leaf mismatch with different verbage?

Yeah good call. That probably would be a good idea, but we can wait until that situation gets reported if you want; I'm thinking it'll be easier to come up with good verbiage given a concrete example

@aryairani aryairani enabled auto-merge August 13, 2025 20:39
@aryairani aryairani merged commit 63477ee into trunk Aug 13, 2025
31 checks passed
@aryairani aryairani deleted the topic/mismatch-message branch August 13, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

type errors can be wrong-kinded

3 participants