-
Notifications
You must be signed in to change notification settings - Fork 224
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
Dialect: add allowStarAsTypePlaceholder #2885
Conversation
This allows scala2->3 migration via kind-projector.
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.
Is that actually supported? I am getting:
class dotty.tools.dotc.reporting.Diagnostic$Error at Section.scala:[43..44]: Not found: type *,
for:
type Combine = List[*]
Ach, that needs an additional flag |
@@ -142,6 +142,7 @@ package object dialects { | |||
.withAllowStarWildcardImport(true) | |||
.withAllowProcedureSyntax(false) | |||
.withAllowDoWhile(false) | |||
.withAllowStarAsTypePlaceholder(true) |
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.
This shouldn't be true by default, since it needs the additional flag. Do we actually need to change it in the parser? *
will be treated as identifier, so everything should parse ok.
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.
so if we return the Ident tree here, do we really need the "allow plus minus underscore Ident" flag which is really about the same but with an underscore instead? or if we need the flag, should we return the anonymous param tree then, not Ident?
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 guess ident would only help with single *
but not really with -
and +
before it. 🤔
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.
Actually, we might need this by default anyway, since it might be problematic to add it manually for people.
This allows scala2->3 migration via kind-projector. Helps with #2807.