-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Regression in 3.3.1: Compiler crash "assertion failed: NoType" #18934
Comments
Thank you for the minimisation, I was able to reproduce it on my machine. |
I think it is not specified how the compiler should behave in case of binary incompatibility of 2 libraries. Even if we'd adjust the code to compile (see snippet below) and we would be able to pass it through all transform phases it still would fail in the backend: //> using dep dev.zio::zio-interop-cats:3.1.1.0
//> using dep dev.zio::zio-http:3.0.0-RC3
import zio.{Runtime,Task}
import cats.effect.Async
import zio.interop.catz.*
given [T]: zio.Runtime[T] = ???
def foo = cats.effect.Async.apply[Task] results in
However, in each case we should try to provide a meaningfull error message. |
Bisect points that the compiler started crashing after extending the implicit search mechanism in ea13cad Probably the Last good release: 3.3.1-RC1-bin-20230131-42f2764-NIGHTLY |
Yeah, I just copy-pasted the sbt line from the ZIO documentation. Thanks for the hint that updating that stops the compiler from crashing. |
The implicit search seems to fails because the package object clock:
type Clock = Hash[Clock.Service]
object Clock:
trait Service
but in ZIO 2.x it's a regular trait Because in any case the compilation should fail either with error or crash I have no idea how to reproduce it for the Vulpix regression tests. |
I addressed how that change addressed a related crash with the fix (and follow up to the fix) #18719 and #18727. But I'm not sure how exactly that affects the issue here. |
It seems that it is still failing in nightly - 3.4.0-RC1-bin-20231117-5bb6f0d-NIGHTLY I'm adding stacktrace of the crash below scala-cli compile main.scala -S 3.nightly --server=false
dotty.tools.FatalError: cannot resolve reference to type zio.type.ZManaged
the classfile defining the type might be missing from the classpath
at dotty.tools.FatalError$.apply(FatalError.scala:3)
at dotty.tools.dotc.core.TypeErasure.checkedSuperType(TypeErasure.scala:761)
at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$apply(TypeErasure.scala:644)
at dotty.tools.dotc.core.TypeErasure.paramErasure$1(TypeErasure.scala:692)
at dotty.tools.dotc.core.TypeErasure.$anonfun$1(TypeErasure.scala:700)
at scala.collection.immutable.List.mapConserve(List.scala:472)
at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$apply(TypeErasure.scala:700)
at dotty.tools.dotc.core.TypeErasure.eraseResult(TypeErasure.scala:880)
at dotty.tools.dotc.core.TypeErasure.eraseInfo(TypeErasure.scala:816)
at dotty.tools.dotc.core.TypeErasure$.transformInfo(TypeErasure.scala:274)
at dotty.tools.dotc.transform.Erasure.transform(Erasure.scala:97)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:832)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:124)
at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:118)
at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:111)
at dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:498)
at dotty.tools.dotc.transform.Mixin.needsTraitSetter(Mixin.scala:174)
at dotty.tools.dotc.transform.Mixin.transformSym$$anonfun$1(Mixin.scala:153)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.core.Scopes$Scope.foreach(Scopes.scala:94)
at dotty.tools.dotc.transform.Mixin.transformSym(Mixin.scala:157)
at dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform(DenotTransformers.scala:70)
at dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform$(DenotTransformers.scala:65)
at dotty.tools.dotc.transform.Mixin.transform(Mixin.scala:113)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:832)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:849)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:878)
at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:124)
at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:118)
at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:111)
at dotty.tools.dotc.core.Symbols$ClassSymbol.classDenot(Symbols.scala:485)
at dotty.tools.dotc.core.Symbols$.toClassDenot(Symbols.scala:501)
at dotty.tools.backend.jvm.BTypesFromSymbols.$anonfun$1(BTypesFromSymbols.scala:115)
at scala.collection.Iterator$$anon$10.nextCur(Iterator.scala:594)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:608)
at scala.collection.mutable.Growable.addAll(Growable.scala:61)
at scala.collection.mutable.Growable.addAll$(Growable.scala:57)
at scala.collection.immutable.SetBuilderImpl.addAll(Set.scala:405)
at scala.collection.immutable.Set$.from(Set.scala:362)
at scala.collection.IterableOnceOps.toSet(IterableOnce.scala:1322)
at scala.collection.IterableOnceOps.toSet$(IterableOnce.scala:1322)
at scala.collection.AbstractIterator.toSet(Iterator.scala:1300)
at dotty.tools.backend.jvm.BTypesFromSymbols.superInterfaces$1(BTypesFromSymbols.scala:115)
at dotty.tools.backend.jvm.BTypesFromSymbols.setClassInfo(BTypesFromSymbols.scala:123)
at dotty.tools.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol$$anonfun$1(BTypesFromSymbols.scala:65)
at scala.collection.mutable.HashMap.getOrElse(HashMap.scala:451)
at dotty.tools.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:66)
at dotty.tools.backend.jvm.BTypesFromSymbols.setClassInfo(BTypesFromSymbols.scala:106)
at dotty.tools.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol$$anonfun$1(BTypesFromSymbols.scala:65)
at scala.collection.mutable.HashMap.getOrElse(HashMap.scala:451)
at dotty.tools.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:66)
at dotty.tools.backend.jvm.BCodeHelpers$BCInnerClassGen.getClassBType(BCodeHelpers.scala:178)
at dotty.tools.backend.jvm.BCodeHelpers$BCInnerClassGen.getClassBType$(BCodeHelpers.scala:130)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.getClassBType(BCodeSkelBuilder.scala:134)
at dotty.tools.backend.jvm.BCodeHelpers.primitiveOrClassToBType$1$$anonfun$1(BCodeHelpers.scala:715)
at scala.collection.immutable.HashMap.getOrElse(HashMap.scala:722)
at dotty.tools.backend.jvm.BCodeHelpers.primitiveOrClassToBType$1(BCodeHelpers.scala:715)
at dotty.tools.backend.jvm.BCodeHelpers.dotty$tools$backend$jvm$BCodeHelpers$$typeToTypeKind(BCodeHelpers.scala:734)
at dotty.tools.backend.jvm.BCodeHelpers$BCInnerClassGen.toTypeKind(BCodeHelpers.scala:202)
at dotty.tools.backend.jvm.BCodeHelpers$BCInnerClassGen.toTypeKind$(BCodeHelpers.scala:130)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.toTypeKind(BCodeSkelBuilder.scala:134)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.tpeTK(BCodeSkelBuilder.scala:166)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:298)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadQualifier(BCodeBodyBuilder.scala:1193)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:836)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadTo(BCodeBodyBuilder.scala:387)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:305)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.loop$1(BCodeBodyBuilder.scala:1211)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadArguments(BCodeBodyBuilder.scala:1218)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:837)
at dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadTo(BCodeBodyBuilder.scala:387)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.emitNormalMethodBody$1(BCodeSkelBuilder.scala:893)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genDefDef(BCodeSkelBuilder.scala:916)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:693)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen$$anonfun$1(BCodeSkelBuilder.scala:699)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:699)
at dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genPlainClass(BCodeSkelBuilder.scala:293)
at dotty.tools.backend.jvm.CodeGen.genClass(CodeGen.scala:155)
at dotty.tools.backend.jvm.CodeGen.genClassDef$1(CodeGen.scala:63)
at dotty.tools.backend.jvm.CodeGen.genClassDefs$1(CodeGen.scala:118)
at dotty.tools.backend.jvm.CodeGen.genClassDefs$1$$anonfun$1(CodeGen.scala:116)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.backend.jvm.CodeGen.genClassDefs$1(CodeGen.scala:116)
at dotty.tools.backend.jvm.CodeGen.genUnit(CodeGen.scala:121)
at dotty.tools.backend.jvm.GenBCode.run(GenBCode.scala:83)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:345)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:351)
at dotty.tools.backend.jvm.GenBCode.runOn(GenBCode.scala:91)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:337)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:348)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:357)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:71)
at dotty.tools.dotc.Run.compileUnits(Run.scala:357)
at dotty.tools.dotc.Run.compileSources(Run.scala:261)
at dotty.tools.dotc.Run.compile(Run.scala:246)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
at dotty.tools.dotc.Driver.process(Driver.scala:197)
at dotty.tools.dotc.Driver.process(Driver.scala:165)
at dotty.tools.dotc.Driver.process(Driver.scala:177)
at dotty.tools.dotc.Driver.main(Driver.scala:207)
at dotty.tools.dotc.Main.main(Main.scala)
Error while emitting /Users/wmazur/projects/sandbox/main.scala
cannot resolve reference to type zio.type.ZManaged
the classfile defining the type might be missing from the classpath |
Hi,
The project in the attachment makes the Scala 3.3.1 compiler crash on my machine. The complete code is:
And the important bit of the error message seems to be this:
I have attached the complete output of
sbt compile
as a log file.The crash goes away when I do either of the following:
"dev.zio" %% "zio-http" % "3.0.0-RC2"
from build.sbtscalaVersion
to3.3.0
in build.sbtIt then prints the following error:
minimized.tar.gz
sbt-compile.log
The text was updated successfully, but these errors were encountered: