-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bounds of match type cases #14645
Fix bounds of match type cases #14645
Conversation
d67ceec
to
0e578f1
Compare
…s for the applied arguments
0e578f1
to
3a00dc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a full understanding of the match type logic but my gut reaction here is that this is a lot of code in TypeAssigner which is supposed to be mostly straightforward. Can we ensure these symbols have the correct info at the point they're created (both in typer and treeunpicker) instead?
I don't see how to do that. The loop is in typing the arg of the AppliedTypeTree (typedAppliedTypeTree) and the symbols are created in typing the bind (typedBind). In my example I need the symbol for A so I can use it as the upper bound of the symbol for X. But there's no restriction on the definition order, so I could be typing the binding for X before I've even got a symbol for A. So unless you can see another way to pipe and order things, I propose we use the substitute mechanism to post-process them. There's seems to be a bunch of precedent for doing things very similarly to how I am, or at least to my eyes... |
cc also @odersky, in case he can recommend better ways or places to do this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'm happy that we fix this at the source, in TypeAssigner.
No description provided.