Skip to content
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

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Conversation

kitbellew
Copy link
Contributor

This allows scala2->3 migration via kind-projector. Helps with #2807.

This allows scala2->3 migration via kind-projector.
Copy link
Collaborator

@tgodzik tgodzik left a 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[*]

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 26, 2022

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 -Ykind-projector

@@ -142,6 +142,7 @@ package object dialects {
.withAllowStarWildcardImport(true)
.withAllowProcedureSyntax(false)
.withAllowDoWhile(false)
.withAllowStarAsTypePlaceholder(true)
Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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. 🤔

Copy link
Collaborator

@tgodzik tgodzik left a 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.

@kitbellew kitbellew merged commit 402d8a6 into scalameta:main Sep 26, 2022
@kitbellew kitbellew deleted the 2807_6 branch September 26, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants