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

latest 2.13.x compiler crash with "val _ = 42" #11374

Closed
xuwei-k opened this issue Jan 21, 2019 · 2 comments · Fixed by scala/scala#7669
Closed

latest 2.13.x compiler crash with "val _ = 42" #11374

xuwei-k opened this issue Jan 21, 2019 · 2 comments · Fixed by scala/scala#7669

Comments

@xuwei-k
Copy link

xuwei-k commented Jan 21, 2019

build.sbt

resolvers += "scala-pr" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"

scalaVersion := "2.13.0-pre-9e26448"

A.scala

package example

class A {
  val `_` = 42
}
[info] Compiling 1 Scala source to /Users/kenji/xuwei-k/scala-latest/target/scala-2.13.0-pre-9e26448/classes ...
exception when typing <_: error>.==(x1)/class scala.reflect.internal.Trees$Apply
not found: value _ in file /Users/kenji/xuwei-k/scala-latest/A.scala
scala.reflect.internal.Types$TypeError: not found: value _
[error] 
[error]   unrecoverable error
[error]      while compiling: /Users/kenji/xuwei-k/scala-latest/A.scala
[error]         during phase: globalPhase=erasure, enteringPhase=posterasure
[error]      library version: version 2.13.0-pre-9e26448
[error]     compiler version: version 2.13.0-pre-9e26448
[error]   reconstructed args: -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/classes:/Users/kenji/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-pre-9e26448.jar -classpath /Users/kenji/xuwei-k/scala-latest/target/scala-2.13.0-pre-9e26448/classes
[error] 
[error]   last tree to typer: Ident(x)
[error]        tree position: line 4 of /Users/kenji/xuwei-k/scala-latest/A.scala
[error]               symbol: value x
[error]    symbol definition: x: scala.runtime.BoxedUnit (a TermSymbol)
[error]       symbol package: <none>
[error]        symbol owners: value x
[error]            call site: class A in package example in package example
[error] 
[error] == Source file context for tree position ==
[error] 
[error]      1 package example
[error]      2 
[error]      3 class A {
[error]      4   val `_` = 42
[error]      5 }
[error]      6 
exception when typing if (<_: error>.==(x1))
  matchEnd4(())
else
  case6()
exception when typing case5(){
  if (<_: error>.==(x1))
    matchEnd4(())
  else
    case6()
}
exception when typing {
  case <synthetic> val x1: Int = (42: Int(42));
  case5(){
    if (<_: error>.==(x1))
      matchEnd4(())
    else
      case6()
  };
  case6(){
    matchEnd4(throw new MatchError(x1))
  };
  matchEnd4(x){
    x
  }
}
exception when typing <synthetic> <artifact> private[this] val x$1: scala.runtime.BoxedUnit = {
  case <synthetic> val x1: Int = (42: Int(42));
  case5(){
    if (<_: error>.==(x1))
      matchEnd4(())
    else
      case6()
  };
  case6(){
    matchEnd4(throw new MatchError(x1))
  };
  matchEnd4(x){
    x
  }
}
exception when typing class A extends Object {
  def <init>(): example.A = {
    A.super.<init>();
    ()
  };
  <synthetic> <artifact> private[this] val x$1: scala.runtime.BoxedUnit = {
    case <synthetic> val x1: Int = (42: Int(42));
    case5(){
      if (<_: error>.==(x1))
        matchEnd4(())
      else
        case6()
    };
    case6(){
      matchEnd4(throw new MatchError(x1))
    };
    matchEnd4(x){
      x
    }
  }
}
exception when typing package example {
  class A extends Object {
    def <init>(): example.A = {
      A.super.<init>();
      ()
    };
    <synthetic> <artifact> private[this] val x$1: scala.runtime.BoxedUnit = {
      case <synthetic> val x1: Int = (42: Int(42));
      case5(){
        if (<_: error>.==(x1))
          matchEnd4(())
        else
          case6()
      };
      case6(){
        matchEnd4(throw new MatchError(x1))
      };
      matchEnd4(x){
        x
      }
    }
  }
}
[error] ## Exception when compiling 1 sources to /Users/kenji/xuwei-k/scala-latest/target/scala-2.13.0-pre-9e26448/classes
[error] 
[error]   unrecoverable error
[error]      while compiling: /Users/kenji/xuwei-k/scala-latest/A.scala
[error]         during phase: globalPhase=erasure, enteringPhase=posterasure
[error]      library version: version 2.13.0-pre-9e26448
[error]     compiler version: version 2.13.0-pre-9e26448
[error]   reconstructed args: -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/classes:/Users/kenji/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-pre-9e26448.jar -classpath /Users/kenji/xuwei-k/scala-latest/target/scala-2.13.0-pre-9e26448/classes
[error] 
[error]   last tree to typer: Ident(x)
[error]        tree position: line 4 of /Users/kenji/xuwei-k/scala-latest/A.scala
[error]               symbol: value x
[error]    symbol definition: x: scala.runtime.BoxedUnit (a TermSymbol)
[error]       symbol package: <none>
[error]        symbol owners: value x
[error]            call site: class A in package example in package example
[error] 
[error] == Source file context for tree position ==
[error] 
[error]      1 package example
[error]      2 
[error]      3 class A {
[error]      4   val `_` = 42
[error]      5 }
[error]      6 
[error] scala.reflect.internal.Reporting.abort(Reporting.scala:68)
[error] scala.reflect.internal.Reporting.abort$(Reporting.scala:64)
[error] scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:26)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:804)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedIf$1(Typers.scala:5804)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5670)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5704)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedLabelDef(Typers.scala:5815)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5685)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5704)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5804)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3300)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3300)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2444)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5669)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5704)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedValDefImpl(Typers.scala:5995)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:2007)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5648)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5804)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3300)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3300)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1960)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1799)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5650)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5804)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3300)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3300)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5350)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5653)
[error] scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] scala.tools.nsc.transform.Erasure$ErasureTransformer.$anonfun$transform$2(Erasure.scala:1371)
[error] scala.tools.nsc.transform.Erasure$ErasureTransformer.transform(Erasure.scala:1371)
[error] scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:162)
[error] scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:37)
[error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:447)
[error] scala.tools.nsc.Global$GlobalPhase.run(Global.scala:398)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1480)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1464)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1456)
[error] scala.tools.nsc.Global$Run.compile(Global.scala:1580)
[error] xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
[error] xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
[error] xsbt.CompilerInterface.run(CompilerInterface.scala:31)
[error] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] java.lang.reflect.Method.invoke(Method.java:498)
[error] sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
[error] sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
[error] sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
[error] sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
[error] sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
[error] sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] sbt.std.Transform$$anon$4.work(System.scala:67)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] sbt.Execute.work(Execute.scala:278)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] java.lang.Thread.run(Thread.java:748)
[error]            
[error] scala.reflect.internal.FatalError: 
[error]   unrecoverable error
[error]      while compiling: /Users/kenji/xuwei-k/scala-latest/A.scala
[error]         during phase: globalPhase=erasure, enteringPhase=posterasure
[error]      library version: version 2.13.0-pre-9e26448
[error]     compiler version: version 2.13.0-pre-9e26448
[error]   reconstructed args: -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/classes:/Users/kenji/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-pre-9e26448.jar -classpath /Users/kenji/xuwei-k/scala-latest/target/scala-2.13.0-pre-9e26448/classes
[error] 
[error]   last tree to typer: Ident(x)
[error]        tree position: line 4 of /Users/kenji/xuwei-k/scala-latest/A.scala
[error]               symbol: value x
[error]    symbol definition: x: scala.runtime.BoxedUnit (a TermSymbol)
[error]       symbol package: <none>
[error]        symbol owners: value x
[error]            call site: class A in package example in package example
[error] 
[error] == Source file context for tree position ==
[error] 
[error]      1 package example
[error]      2 
[error]      3 class A {
[error]      4   val `_` = 42
[error]      5 }
[error]      6 
[error] 	at scala.reflect.internal.Reporting.abort(Reporting.scala:68)
[error] 	at scala.reflect.internal.Reporting.abort$(Reporting.scala:64)
[error] 	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:26)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:804)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedIf$1(Typers.scala:5804)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5670)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5704)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedLabelDef(Typers.scala:5815)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5685)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5704)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5804)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3300)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3300)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2444)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5669)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5704)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedValDefImpl(Typers.scala:5995)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:2007)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5648)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5804)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3300)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3300)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1960)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1799)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5650)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5804)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3300)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3300)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5350)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5653)
[error] 	at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:797)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5740)
[error] 	at scala.tools.nsc.transform.Erasure$ErasureTransformer.$anonfun$transform$2(Erasure.scala:1371)
[error] 	at scala.tools.nsc.transform.Erasure$ErasureTransformer.transform(Erasure.scala:1371)
[error] 	at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:162)
[error] 	at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:37)
[error] 	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:447)
[error] 	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:398)
[error] 	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1480)
[error] 	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1464)
[error] 	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1456)
[error] 	at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
[error] 	at xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
[error] 	at xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
[error] 	at xsbt.CompilerInterface.run(CompilerInterface.scala:31)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.lang.reflect.Method.invoke(Method.java:498)
[error] 	at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
[error] 	at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
[error] 	at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
[error] 	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
[error] 	at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
[error] 	at sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
[error] 	at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
[error] 	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] (Compile / compileIncremental) scala.reflect.internal.FatalError: 
[error]   unrecoverable error
[error]      while compiling: /Users/kenji/xuwei-k/scala-latest/A.scala
[error]         during phase: globalPhase=erasure, enteringPhase=posterasure
[error]      library version: version 2.13.0-pre-9e26448
[error]     compiler version: version 2.13.0-pre-9e26448
[error]   reconstructed args: -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/classes:/Users/kenji/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-pre-9e26448.jar -classpath /Users/kenji/xuwei-k/scala-latest/target/scala-2.13.0-pre-9e26448/classes
[error] 
[error]   last tree to typer: Ident(x)
[error]        tree position: line 4 of /Users/kenji/xuwei-k/scala-latest/A.scala
[error]               symbol: value x
[error]    symbol definition: x: scala.runtime.BoxedUnit (a TermSymbol)
[error]       symbol package: <none>
[error]        symbol owners: value x
[error]            call site: class A in package example in package example
[error] 
[error] == Source file context for tree position ==
[error] 
[error]      1 package example
[error]      2 
[error]      3 class A {
[error]      4   val `_` = 42
[error]      5 }
[error]      6 
[error] Total time: 0 s, completed Jan 21, 2019 3:24:06 PM
@xuwei-k xuwei-k added this to the 2.13.0-RC1 milestone Jan 21, 2019
@szeiger
Copy link

szeiger commented Jan 21, 2019

Related issues: #10384 #7691

@som-snytt
Copy link

som-snytt commented Jan 21, 2019

I broke this for 7691, fix attached, but the following is already broken on 2.12 with the same failure:

val Some(`_`) = Option(42)

Edit: fixed the second symptom on the ticket, though it's probably throwaway code no one will exercise except Jenkins and @xuwei-k

(10384 is surely the correct fix, perhaps allowing backticked reference to Java members.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants