-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unsoundness in the Reflection Typed
#12222
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
Milestone
Comments
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 23, 2021
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 23, 2021
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 23, 2021
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 24, 2021
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 24, 2021
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 26, 2021
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
olsdavis
pushed a commit
to olsdavis/dotty
that referenced
this issue
Apr 4, 2022
TypeOrTest can match or construct type tests or ascriptions `x: T` in expressions or patterns. Unlike `Typed`, it contains a `Tree` instead of a `Term` which might be one of the patterns trees. Fixes scala#12222
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.0.0-RC3
Issue
Typed
assumes that it is typing aTerm
but it might also be a pattern.Alternatives
Unpaplly
(has an extra buggy workaround see Inconsistency between reflect Typed and #12221)Bind
Solution 1
Make
Typed
contain aTree
.This is a simple change at the definition site, but it has an impact at the use site.
For all
Typed
that are terms we would need to do:Solution 2
Create an alternative type such as
TypedTree
which handles the cases where theexpr
is not aTerm
.There might be a subtyping relationship
Typed <:< TypedTree
.The text was updated successfully, but these errors were encountered: