Refactor signature relatability#6142
Conversation
There was a problem hiding this comment.
Isn't it a regression to drop these lines?
There was a problem hiding this comment.
Yup. I've noted that elsewhere in the PR. Mostly I'm trying to see whether this is an appropriate direction to move in. I need to figure out how to maintain this.
There was a problem hiding this comment.
Are these losses primarily because of the covariant / contravariant reversal, or something else in the change? It might be good to swap them back, just to see if it makes the errors go away.
|
I tried reverting the order of source/target on parameters to recover the lost error elaborations. Unfortunately, that introduces a bug in which for the following: function foo<T extends "foo">(f: (x: T) => T) {
return f;
}
let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo")We report Which is
I'd rather not introduce a callback to revert the elaboration stack between calls to |
df72843 to
4502213
Compare
I totally have an infinite amount of time to work on this.
|
Hey @sandersn and @JsonFreeman any other feedback? I think I've improved error baselines by elaborating in most cases except for primitives. I've also simplified the code by eliminating that |
There was a problem hiding this comment.
The primitive baselines seem good to simplify, but what about these? Is it OK to drop these elaborations?
There was a problem hiding this comment.
Never mind, maybe I shouldn't be reviewing code while I'm sick. I didn't see that it's an insertion not a deletion.
|
Looks good to me. But as I said, I'm sick, so make sure @JsonFreeman or future-me (the not-sick one) okays it too. |
|
Reviewed the error baselines in detail and it's a great improvement. I'm not as familiar with this part of the signature checking code so I'd defer to someone else on that front -- there was nothing obvious wrong about it, though. |
This PR is an attempt to remove duplicated code brought in by #6075.
It is still a work in progress, since there has been a small regression in error reporting.
@sandersn and @JsonFreeman, you two might want to take a look.