Skip to content

erased is still considered a keyword even without -Yerased-terms #7944

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

Closed
sjrd opened this issue Jan 9, 2020 · 0 comments
Closed

erased is still considered a keyword even without -Yerased-terms #7944

sjrd opened this issue Jan 9, 2020 · 0 comments
Assignees

Comments

@sjrd
Copy link
Member

sjrd commented Jan 9, 2020

minimized code

package hello

object HelloWorld {
  def main(args: Array[String]): Unit =
    println(erased(5))

  def erased(x: Int): Any = x
}

Compilation output:

[error] -- [E018] Syntax Error: hello.scala:5:12 
[error] 5 |    println(erased(5))
[error]   |            ^^^^^^
[error]   |            expression expected but erased found
[error] -- [E040] Syntax Error: hello.scala:7:6 
[error] 7 |  def erased(x: Int): Any = x
[error]   |      ^^^^^^
[error]   |      an identifier expected, but 'erased' found
[error] two errors found

expectation

I expect the above program to compile and run, given that I don't pass the -Yerased-terms argument.

See also: the recent PR #7906.

@sjrd sjrd added the itype:bug label Jan 9, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 9, 2020
@nicolasstucki nicolasstucki self-assigned this Jan 9, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 9, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 10, 2020
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 10, 2020
anatoliykmetyuk added a commit that referenced this issue Jan 10, 2020
Fix #7944: Only treat erased as a keyword under -Yerased-terms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants