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

Regression in parser for usage of user defined inflix trait as #21769

Open
WojciechMazur opened this issue Oct 15, 2024 · 1 comment
Open

Regression in parser for usage of user defined inflix trait as #21769

WojciechMazur opened this issue Oct 15, 2024 · 1 comment
Assignees
Labels
area:experimental:modularity Issues related to the modularity extension. area:parser area:spec itype:bug regression This worked in a previous version but doesn't anymore

Comments

@WojciechMazur
Copy link
Contributor

Based on OpenCB failure in makiftutuncu/as - build logs

Based on the current syntax as keyword can be present only in NamedSelector which can be placed only in the import statement.
AFAIK under the new givens syntax as keyword can be present only within type definition context bounds, however, it is not documented in any form.

Compiler version

Last good release: 3.6.0-RC1-bin-20241003-a672e05-NIGHTLY
First bad release: 3.6.0-RC1-bin-20241005-6fa81cf-NIGHTLY

Bisect points to 14acdc0

Minimized code

infix trait as[From, To]

val conv: (String as Int) = ???
given instance: (String as Int) = ???
def test(ev: (String as Int)) = ???

Output

-- [E040] Syntax Error: /Users/wmazur/projects/sandbox/test.scala:3:18 --------------------------------------------------------------------------------------------------------------------
3 |val conv: (String as Int) = ???
  |                  ^^
  |                  ')' expected, but identifier found
-- [E040] Syntax Error: /Users/wmazur/projects/sandbox/test.scala:4:24 --------------------------------------------------------------------------------------------------------------------
4 |given instance: (String as Int) = ???
  |                        ^^
  |                        ',' or ')' expected, but identifier found
-- [E040] Syntax Error: /Users/wmazur/projects/sandbox/test.scala:5:21 --------------------------------------------------------------------------------------------------------------------
5 |def test(ev: (String as Int)) = ???
  |                     ^^
  |                     ')' expected, but identifier found
3 errors found

Expectation

Should be parsable or syntax reference should be updated.

@WojciechMazur WojciechMazur added itype:bug area:parser regression This worked in a previous version but doesn't anymore area:spec labels Oct 15, 2024
@hamzaremmal
Copy link
Member

Duplicate of #21426

@hamzaremmal hamzaremmal marked this as a duplicate of #21426 Oct 15, 2024
@Gedochao Gedochao added the area:experimental:modularity Issues related to the modularity extension. label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:experimental:modularity Issues related to the modularity extension. area:parser area:spec itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

No branches or pull requests

4 participants