experiment: Try pretty-printing a diff when subtyping fails#5745
experiment: Try pretty-printing a diff when subtyping fails#5745
Conversation
|
Funnily enough, I was thinking of something similar, but instead of representing the context as text, you represent it as a OCaml function of type Might produce sucky messages of course and not quite sure what to do about definition (perhaps you just unfold them). |
Hm, that would have a single context and two different ty1 and ty2, yes? But with subtyping the context for both could be different, just compatible e.g. Anyway, I've tried this idea last week as an improvement for https://linear.app/caffeinelabs/issue/LANG-45/unsupported-additional-field-when-missing-in-both-oldactor-and but now I'm not sure it is better than a RAG entry... |
Idea / Specification
Print both types focusing on incompatible path found during subtype check.
It should print type aliases plus their normalized form.
It should skip most of the compatible fields to focus on the difference, but it should include some of the correct fields to keeps the surrounding (best to keep the 2 surrounding fields from the source, but what if they are sorted?)