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

NPE when using -Yrecursion #1472

Closed
scabug opened this issue Nov 2, 2008 · 5 comments
Closed

NPE when using -Yrecursion #1472

scabug opened this issue Nov 2, 2008 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 2, 2008

The attached/below code will fail with a cyclic reference error if compiled without -Yrecursion, and will produce a NPE when compiled with -Yrecursion.

object Test extends Application {
  type SA = { type U; type T; val f : T => (U, T) }
  type SB = { type U; type T; val g : T => (U, T) }

  type S = { type Utmp = this.b.type#U
             type Ttmp = this.a.type#T
             val a : (SA { type U = Utmp })
             val b : (SB { type T = Ttmp }) }

  val AB : S = new { self =>
    type Utmp = this.b.type#U
    type Ttmp = this.a.type#T 
    val a : (SA { type U = self.type#Utmp }) = null
    val b : (SB { type T = self.type#Ttmp }) = null
  }
}
 
/* 
structure AB = rec (X : S) struct
  structure A :> (SA where type u = X.B.u)
    type u = X.B.u
    type t = int
    fun f (x:t) : u * t =
        let val (y,z) = X.B.g(x+3) (* Error
        in (y,z+5) end              (* Error
    ...
  end
  structure B :> (SB where type t = X.A.t)
    type t = X.A.t
    type u = bool
    fun g (x:t) : u * t = ...X.A.f(...)...
    ...
  end

*/
@scabug
Copy link
Author

scabug commented Nov 2, 2008

Imported From: https://issues.scala-lang.org/browse/SI-1472?orig=1
Reporter: Geoffrey Alan Washburn (washburn)
Attachments:

@scabug
Copy link
Author

scabug commented Jan 20, 2009

Geoffrey Alan Washburn (washburn) said:
Reassigning to scala_community as it is unlikely I will ever fix this issue.

@eed3si9n
Copy link
Member

On 2.13.0-M3, I do not get NPE, but I get an assertion failure.

  1. Could we remove help-wanted label?
  2. I'd vote to close this as won't fix.

error

sbt:Hello> compile
[info] Compiling 1 Scala source to /Users/eed3si9n/work/quicktest/t1472/target/scala-2.13.0-M3/classes ...
[error] /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala:7:37: illegal cyclic reference involving type Utmp
[error]              val a : (SA { type U = Utmp })
[error]                                     ^
[error] /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala:12:22: illegal cyclic reference involving type U
[error]     type Ttmp = this.a.type#T
[error]                      ^
[error] ## Exception when compiling 1 sources to /Users/eed3si9n/work/quicktest/t1472/target/scala-2.13.0-M3/classes
[error] assertion failed:
[error]   AdaptTypeError - foundType is Erroneous: AnyRef{type Utmp = this.b.U; type Ttmp = <error>; val a: Test.SA{type U = this.Utmp}; val a: Test.SA{type U = this.Utmp}; val b: Test.SB{type T = this.Ttmp}; val b: Test.SB{type T = this.Ttmp}}
[error]      while compiling: /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala
[error]         during phase: typer
[error]      library version: version 2.13.0-M3
[error]     compiler version: version 2.13.0-M3
[error]   reconstructed args: -classpath /Users/eed3si9n/work/quicktest/t1472/target/scala-2.13.0-M3/classes -Yrecursion 100 -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/classes:/Users/eed3si9n/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-M3.jar
[error]
[error]   last tree to typer: Select(New, <init>)
[error]        tree position: line 10 of /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala
[error]             tree tpe: ()AnyRef{type Utmp = this.b.U; type Ttmp = <error>; val a: Test.SA{type U = this.Utmp}; val a: Test.SA{type U = this.Utmp}; val b: Test.SB{type T = this.Ttmp}; val b: Test.SB{type T = this.Ttmp}}
[error]               symbol: constructor $anon
[error]    symbol definition: def <init>(): $anon (a MethodSymbol)
[error]       symbol package: <empty>
[error]        symbol owners: constructor $anon -> <$anon: AnyRef> -> value AB -> object Test
[error]            call site: object Test in package <empty>
[error]
[error] == Source file context for tree position ==
[error]
[error]      7              val a : (SA { type U = Utmp })
[error]      8              val b : (SB { type T = Ttmp }) }
[error]      9
[error]     10   val AB : S = new { self =>
[error]     11     type Utmp = this.b.type#U
[error]     12     type Ttmp = this.a.type#T
[error]     13     val a : (SA { type U = self.type#Utmp }) = null
[error] scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:208)
[error] scala.tools.nsc.typechecker.Typers$Typer.adaptMismatchedSkolems$1(Typers.scala:1065)
[error] scala.tools.nsc.typechecker.Typers$Typer.lastTry$1(Typers.scala:1076)
[error] scala.tools.nsc.typechecker.Typers$Typer.adaptExprNotFunMode$1(Typers.scala:1131)
[error] scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1177)
[error] scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1221)
[error] scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5715)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2462)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$98(Typers.scala:5622)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typerWithLocalContext$1(Typers.scala:493)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:493)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5657)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5664)
[error] scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5915)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedValDefImpl(Typers.scala:2070)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:2026)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5600)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5663)
[error] scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5764)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3127)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3271)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3271)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1979)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1854)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5603)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5663)
[error] scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5764)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3127)
[error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3271)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3271)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5311)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5605)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5663)
[error] scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5760)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:104)
[error] scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:436)
[error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:429)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
[error] scala.collection.Iterator.foreach(Iterator.scala:938)
[error] scala.collection.Iterator.foreach$(Iterator.scala:938)
[error] scala.collection.AbstractIterator.foreach(Iterator.scala:1426)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1453)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1437)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1429)
[error] scala.tools.nsc.Global$Run.compile(Global.scala:1546)
[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:83)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:134)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:74)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:117)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:305)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:305)
[error] sbt.internal.inc.Incremental$.doCompile(Incremental.scala:101)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:82)
[error] sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:110)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:57)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:84)
[error] sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:129)
[error] sbt.internal.inc.Incremental$.compile(Incremental.scala:75)
[error] sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:61)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:309)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:267)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:158)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:237)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:68)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1429)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1403)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] sbt.std.Transform$$anon$4.work(System.scala:66)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] sbt.Execute.work(Execute.scala:271)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[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] java.lang.AssertionError: assertion failed:
[error]   AdaptTypeError - foundType is Erroneous: AnyRef{type Utmp = this.b.U; type Ttmp = <error>; val a: Test.SA{type U = this.Utmp}; val a: Test.SA{type U = this.Utmp}; val b: Test.SB{type T = this.Ttmp}; val b: Test.SB{type T = this.Ttmp}}
[error]      while compiling: /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala
[error]         during phase: typer
[error]      library version: version 2.13.0-M3
[error]     compiler version: version 2.13.0-M3
[error]   reconstructed args: -classpath /Users/eed3si9n/work/quicktest/t1472/target/scala-2.13.0-M3/classes -Yrecursion 100 -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/classes:/Users/eed3si9n/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-M3.jar
[error]
[error]   last tree to typer: Select(New, <init>)
[error]        tree position: line 10 of /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala
[error]             tree tpe: ()AnyRef{type Utmp = this.b.U; type Ttmp = <error>; val a: Test.SA{type U = this.Utmp}; val a: Test.SA{type U = this.Utmp}; val b: Test.SB{type T = this.Ttmp}; val b: Test.SB{type T = this.Ttmp}}
[error]               symbol: constructor $anon
[error]    symbol definition: def <init>(): $anon (a MethodSymbol)
[error]       symbol package: <empty>
[error]        symbol owners: constructor $anon -> <$anon: AnyRef> -> value AB -> object Test
[error]            call site: object Test in package <empty>
[error]
[error] == Source file context for tree position ==
[error]
[error]      7              val a : (SA { type U = Utmp })
[error]      8              val b : (SB { type T = Ttmp }) }
[error]      9
[error]     10   val AB : S = new { self =>
[error]     11     type Utmp = this.b.type#U
[error]     12     type Ttmp = this.a.type#T
[error]     13     val a : (SA { type U = self.type#Utmp }) = null
[error] 	at scala.tools.nsc.typechecker.ContextErrors$TyperContextErrors$TyperErrorGen$.AdaptTypeError(ContextErrors.scala:208)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.adaptMismatchedSkolems$1(Typers.scala:1065)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.lastTry$1(Typers.scala:1076)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.adaptExprNotFunMode$1(Typers.scala:1131)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1177)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1221)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5715)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2462)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$98(Typers.scala:5622)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typerWithLocalContext$1(Typers.scala:493)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:493)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5657)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5664)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5915)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedValDefImpl(Typers.scala:2070)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:2026)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5600)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5663)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5764)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3127)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3271)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3271)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1979)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1854)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5603)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5663)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5764)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3127)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3271)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3271)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5311)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5605)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5663)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5701)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5733)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5674)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5679)
[error] 	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5760)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:104)
[error] 	at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:436)
[error] 	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:429)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:938)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:938)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1426)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
[error] 	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1453)
[error] 	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1437)
[error] 	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1429)
[error] 	at scala.tools.nsc.Global$Run.compile(Global.scala:1546)
[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:83)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:134)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:74)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:117)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:305)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:305)
[error] 	at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:101)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:82)
[error] 	at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:110)
[error] 	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:57)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:84)
[error] 	at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:129)
[error] 	at sbt.internal.inc.Incremental$.compile(Incremental.scala:75)
[error] 	at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:61)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:309)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:267)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:158)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:237)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:68)
[error] 	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1429)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1403)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:271)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[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) java.lang.AssertionError: assertion failed:
[error]   AdaptTypeError - foundType is Erroneous: AnyRef{type Utmp = this.b.U; type Ttmp = <error>; val a: Test.SA{type U = this.Utmp}; val a: Test.SA{type U = this.Utmp}; val b: Test.SB{type T = this.Ttmp}; val b: Test.SB{type T = this.Ttmp}}
[error]      while compiling: /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala
[error]         during phase: typer
[error]      library version: version 2.13.0-M3
[error]     compiler version: version 2.13.0-M3
[error]   reconstructed args: -classpath /Users/eed3si9n/work/quicktest/t1472/target/scala-2.13.0-M3/classes -Yrecursion 100 -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/classes:/Users/eed3si9n/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.13.0-M3.jar
[error]
[error]   last tree to typer: Select(New, <init>)
[error]        tree position: line 10 of /Users/eed3si9n/work/quicktest/t1472/src/main/scala/example/Hello.scala
[error]             tree tpe: ()AnyRef{type Utmp = this.b.U; type Ttmp = <error>; val a: Test.SA{type U = this.Utmp}; val a: Test.SA{type U = this.Utmp}; val b: Test.SB{type T = this.Ttmp}; val b: Test.SB{type T = this.Ttmp}}
[error]               symbol: constructor $anon
[error]    symbol definition: def <init>(): $anon (a MethodSymbol)
[error]       symbol package: <empty>
[error]        symbol owners: constructor $anon -> <$anon: AnyRef> -> value AB -> object Test
[error]            call site: object Test in package <empty>
[error]
[error] == Source file context for tree position ==
[error]
[error]      7              val a : (SA { type U = Utmp })
[error]      8              val b : (SB { type T = Ttmp }) }
[error]      9
[error]     10   val AB : S = new { self =>
[error]     11     type Utmp = this.b.type#U
[error]     12     type Ttmp = this.a.type#T
[error]     13     val a : (SA { type U = self.type#Utmp }) = null

@SethTisue
Copy link
Member

SethTisue commented Feb 26, 2018

Could we remove help-wanted label?

done

I had to look up what -Yrecursion even is:

src/compiler/scala/tools/nsc/settings/ScalaSettings.scala:
  val Yrecursion      = IntSetting        (
    "-Yrecursion", "Set recursion depth used when locking symbols.",
    0, Some((0, Int.MaxValue)), (_: String) => None)

@SethTisue
Copy link
Member

maybe someone on the Scala team whose Scala beard is even longer and grayer than mine could comment on whether a PR removing -Yrecursion entirely would be accepted

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

4 participants