Skip to content

Error in rhs of identifier leads to spurious errors later on #2730

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
smarter opened this issue Jun 10, 2017 · 2 comments
Closed

Error in rhs of identifier leads to spurious errors later on #2730

smarter opened this issue Jun 10, 2017 · 2 comments
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc exp:advanced itype:bug prio:low

Comments

@smarter
Copy link
Member

smarter commented Jun 10, 2017

This code should print one error but prints two:

object Test {
  def test: Unit = {
    val x = iDontExist(32) // error: not found: iDontExist
    val y = x
    x + x
    println(x)
  }
}
-- [E006] Unbound Identifier Error: try/nometh.scala:3:12 ----------------------
3 |    val x = iDontExist(32)
  |            ^^^^^^^^^^
  |            not found: iDontExist

longer explanation available when compiling with `-explain`
-- [E006] Unbound Identifier Error: try/nometh.scala:6:12 ----------------------
6 |    println(x)
  |            ^
  |            not found: iDontExist

longer explanation available when compiling with `-explain`

two errors found

Compare with the output you get with scalac:

try/nometh.scala:3: error: not found: value iDontExist
    val x = iDontExist(32)
            ^
one error found

This is somewhat similar to #2412

@smarter smarter added area:reporting Error reporting including formatting, implicit suggestions, etc exp:advanced itype:bug prio:low labels Jun 10, 2017
@smarter
Copy link
Member Author

smarter commented Dec 10, 2017

Fixed but I don't know when.

@smarter smarter closed this as completed Dec 10, 2017
@allanrenucci
Copy link
Contributor

Should be added as a regression test

allanrenucci added a commit to dotty-staging/dotty that referenced this issue Dec 10, 2017
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Dec 10, 2017
allanrenucci added a commit that referenced this issue Dec 10, 2017
vitorsvieira pushed a commit to vitorsvieira/dotty that referenced this issue Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc exp:advanced itype:bug prio:low
Projects
None yet
Development

No branches or pull requests

2 participants