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

Kotlin ::class is interpreted operator followed by class-Keyword #1571

Closed
contradictioned opened this issue Aug 10, 2020 · 0 comments · Fixed by #1572
Closed

Kotlin ::class is interpreted operator followed by class-Keyword #1571

contradictioned opened this issue Aug 10, 2020 · 0 comments · Fixed by #1572
Assignees
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@contradictioned
Copy link
Contributor

Name of the lexer
Kotlin
Code sample
A sample of the code that produces the bug.

when(foo) {
    1 -> "Hello"::class
    2 -> "Bye"::class
}

Code Sample

Additional context

The lexer correctly reads "Hello" as string, :: as operator, and when it reads class it pushes :class on the stack. With this context no matching rule is found and an error is produced.

Working example where the class-name is avoided

when(foo) {
    1 -> "Hello"::klass
    2 -> "Bye"::klass
}

Writing class here is valid syntax. I am interested in fixing this, but I cannot guarantee success ;)

@contradictioned contradictioned added the bugfix-request A request for a bugfix to be developed. label Aug 10, 2020
@contradictioned contradictioned changed the title Kotlin Kotlin ::class is interpreted operator followed by class-Keyword Aug 10, 2020
@pyrmont pyrmont self-assigned this Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants