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

Disallow old uses of quoted and spliced types #15012

Merged

Conversation

nicolasstucki
Copy link
Contributor

These have have been emitting migration warning in 3.0 and 3.1 even if the
syntax was already deprecated in 3.0. These where allowed syntax found
in older papers.

The case '[T] was actually buggy but no one reported this bug so far.
A good indication that this older syntax has not been used in a while.

First step towards fixing #15009.

@nicolasstucki nicolasstucki self-assigned this Apr 22, 2022
@nicolasstucki nicolasstucki marked this pull request as ready for review April 25, 2022 09:39
@nicolasstucki nicolasstucki added the needs-minor-release This PR cannot be merged until the next minor release label Apr 25, 2022
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If we change this, we need to change syntax.md (both versions) as well.

  2. Currently, in syntax.md I find

    paren            ::=  ‘(’ | ‘)’ | ‘[’ | ‘]’ | ‘{’ | ‘}’ | ‘'(’ | ‘'[’ | ‘'{’
    

    That's wrong. isn't it? '{ and friends are two tokens, or not? In that case we need to change this part as well.

  3. I am not sure what the motivation for the change is. If we do use
    '[ ... ] in patterns, would it not be more general to allow it in types as well?

@nicolasstucki
Copy link
Contributor Author

I am not sure what the motivation for the change is.

We do not really change anything in this PR, we are just disallowing the use of syntax that was already deprecated in 3.0.0. This allows us to check the use of this syntax directly into the parser. This refactor makes untpd.TypSplice unnecessary.

@nicolasstucki nicolasstucki added this to the 3.2.0-RC1 milestone May 9, 2022
@nicolasstucki nicolasstucki force-pushed the tighten-quoted-and-spliced-types branch from 459e47d to 8ae971f Compare May 10, 2022 07:57
@nicolasstucki nicolasstucki force-pushed the tighten-quoted-and-spliced-types branch from 8ae971f to 15a1321 Compare May 19, 2022 12:42
@nicolasstucki
Copy link
Contributor Author

rebased

@odersky odersky assigned nicolasstucki and unassigned odersky May 23, 2022
@bishabosha
Copy link
Member

needs another rebase

These have have been emitting migration warning in 3.0 and 3.1 even if the
syntax was already deprecated in 3.0. These where allowed syntax found
in older papers.

The case `'[T]` was actually buggy but no one reported this bug so far.
A good indication that this older syntax has not been used in a while.

First step towards fixing scala#15009.
Now that we do not support the old syntax for splicing types it is not
possible to get this error. The code is buggy and fails with another
error that is not worth testing.
@nicolasstucki nicolasstucki force-pushed the tighten-quoted-and-spliced-types branch from 15a1321 to 9306274 Compare May 24, 2022 09:20
@nicolasstucki
Copy link
Contributor Author

rebased and fixed conflict in ErrorMessageID.scala

@nicolasstucki nicolasstucki enabled auto-merge May 24, 2022 09:24
@nicolasstucki nicolasstucki merged commit 95d9171 into scala:main May 24, 2022
@nicolasstucki nicolasstucki deleted the tighten-quoted-and-spliced-types branch May 24, 2022 12:05
@Kordyjan Kordyjan modified the milestones: 3.2.0-RC1, 3.2.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-minor-release This PR cannot be merged until the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants