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

Compiler crash on undefined symbol in update assignment, symbol value <error> does not exist in #9235

Closed
scabug opened this issue Mar 18, 2015 · 5 comments

Comments

@scabug
Copy link

scabug commented Mar 18, 2015

package foo

case class A(var a: Int)
object Test {
  val as = Map[String, A]()
  as(undefined).a += 1
}

Crashes the type checker with

scala.reflect.internal.FatalError: 
  symbol value <error> does not exist in foo.Test.<init>
     while compiling: /home/crc/transcriptic/src/lab/src/mcx/src/main/scala/com/transcriptic/mcx/devices/validation/Foo.scala
        during phase: icode
     library version: version 2.11.5
    compiler version: version 2.11.5
@scabug
Copy link
Author

scabug commented Mar 18, 2015

Imported From: https://issues.scala-lang.org/browse/SI-9235?orig=1
Reporter: Carl Chatfiled (carlchatfield)
Affected Versions: 2.11.5
See #9781
Duplicates #8763

@scabug
Copy link
Author

scabug commented Apr 16, 2015

@adriaanm said:
Running under -Xprint:typer points towards https://github.com/scala/scala/blob/2.11.x/src/compiler/scala/tools/nsc/typechecker/Typers.scala#L4617

It looks like the error in the RHS of the val (qualqual) is masked by evalOnce's wrapping?

      <synthetic> val ev$1: A = Test.this.as.apply(<undefined: error>);
      ev$1.a_=(ev$1.a.+(1))

@scabug
Copy link
Author

scabug commented Apr 17, 2015

@adriaanm said:
When running under -Ytyper-debug, this looks dubious -- an application to an error-typed arg should be error-typed:

|    |    |    |-- as(<undefined: error>).a EXPRmode-POLYmode-QUALmode (site: method test in Test) 
|    |    |    |    |-- String => A EXPRmode-POLYmode-QUALmode (site: method test in Test) 
|    |    |    |    |    |-- as.apply BYVALmode-EXPRmode-FUNmode-POLYmode (silent: method test in Test) 
|    |    |    |    |    |    \-> (v1: String)A
|    |    |    |    |    \-> A
|    |    |    |    \-> Int

@scabug
Copy link
Author

scabug commented Oct 31, 2016

@liff said:
I think this is duplicate with #9781. The example results in error: not found: value undefined instead of compiler crash on 2.12.x.

@scabug
Copy link
Author

scabug commented Nov 1, 2016

@som-snytt said (edited on Nov 1, 2016 6:23:13 AM UTC):
I didn't notice these issues until just now. By coincidence I just closed another duplicate because there's a PR on 2.11, scala/scala#5454

Did I already know that? (Yes.) It's all ancient history now. It was before the rains returned.

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

1 participant