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

scalac assertion failed (in refchecks): transformCaseApply: name = Some tree #10048

Open
scabug opened this issue Nov 13, 2016 · 1 comment
Open
Milestone

Comments

@scabug
Copy link

scabug commented Nov 13, 2016

scalac-2.12 crashes with the following code.
It also affects 2.11 but 2.9 is fine.

$ scalac -version
Scala compiler version 2.12.0-20161028-204919-0666377 -- Copyright 2002-2016, LAMP/EPFL and Lightbend, Inc.

$ scalac abc.scala 
error: java.lang.AssertionError: assertion failed:
  transformCaseApply: name = Some tree = Some / class scala.reflect.internal.Trees$Ident
     while compiling: abc.scala
        during phase: refchecks
     library version: version 2.12.0-20161028-204919-0666377
    compiler version: version 2.12.0-20161028-204919-0666377
  reconstructed args:

  last tree to typer: TypeTree(class Some)
       tree position: line 6 of abc.scala
            tree tpe: Some[String]
              symbol: (final case) class Some in package scala
   symbol definition: final case class Some[+A] extends Option[A] with Product with Serializable (a ClassSymbol)
      symbol package: scala
       symbol owners: class Some
           call site: class Test in package <empty>

== Source file context for tree position ==

     3   def wrap(f: Any) = ???
     4   wrap {
     5     val c = new Cell(ambiguousName = Some("bla"))
     6     val ambiguousName = Some ambiguousName
     7   }
     8 }
	at scala.tools.nsc.Global.assert(Global.scala:229)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer.transform(RefChecks.scala:1698)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer.transform(RefChecks.scala:107)
	at scala.reflect.internal.Trees.itransform(Trees.scala:1349)
	at scala.reflect.internal.Trees.itransform$(Trees.scala:1340)
	at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
	at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer.transform(RefChecks.scala:1745)
	at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer.transform(RefChecks.scala:107)
	at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1361)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
	at scala.reflect.internal.Trees.itransform(Trees.scala:1360)
	at scala.reflect.internal.Trees.itransform$(Trees.scala:1340)
	at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
	at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
<snipped>

$ cat abc.scala

class Cell(ambiguousName: Option[String])
class Test {
  def wrap(f: Any) = ???
  wrap {
    val c = new Cell(ambiguousName = Some("bla"))
    val ambiguousName = Some ambiguousName
  }
}
@scabug
Copy link
Author

scabug commented Nov 13, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10048?orig=1
Reporter: Qirun Zhang (helloqirun)
Affected Versions: 2.12.0

@scabug scabug added this to the Backlog milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant