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

"AssertionError: duplicate type ..." when importing traits from 2.13.4 compiled library #11173

Closed
marcinzh opened this issue Jan 20, 2021 · 3 comments · Fixed by #12120
Closed

Comments

@marcinzh
Copy link

marcinzh commented Jan 20, 2021

Minimized code

This is peculiar case to minimize, because of the dependency. Scastie seems like the best option to me, I hope it's ok.

Now Scala 3 code. Some import statements trigger the error, some don't:

import turbolift.std_effects.Except      /* ERROR */
import turbolift.std_effects.ExceptK     /* OK */
import turbolift.std_effects.Validation  /* ERROR */
import turbolift.std_effects.ValidationK /* ERROR */

Wildcard import does not trigger the error. But using the imported trait does:

import turbolift.std_effects._             /* OK */

case object MyExcept extends Except[Int]   /* ERROR */

I modified the imported 2.13.4 library by putting cloned definitions of troublesome traits inside object DottyBug {‥}. Now importing works fine:

import turbolift.std_effects.DottyBug.Except       /* OK */
import turbolift.std_effects.DottyBug.ExceptK      /* OK */
import turbolift.std_effects.DottyBug.Validation   /* OK */
import turbolift.std_effects.DottyBug.ValidationK  /* OK */

Output (click arrow to expand)

This output comes from 3.0.0-RC1-bin-20210117-65b17af-NIGHTLY.

For 3.0.0-M3 output, please see provided Scastie link.

java.lang.AssertionError: assertion failed: duplicate type E#7824; previous was type E#7817
    scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
    dotty.tools.dotc.core.Scopes$MutableScope.enter(Scopes.scala:275)
    dotty.tools.dotc.core.SymDenotations$ClassDenotation.enterNoReplace(SymDenotations.scala:1867)
    dotty.tools.dotc.core.SymDenotations$ClassDenotation.enter(SymDenotations.scala:1858)
    dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.finishSym$1(Scala2Unpickler.scala:493)
    dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readDisambiguatedSymbol(Scala2Unpickler.scala:546)
    dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readSymbol(Scala2Unpickler.scala:327)
    dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.run(Scala2Unpickler.scala:182)
    dotty.tools.dotc.core.classfile.ClassfileParser.unpickleScala$1(ClassfileParser.scala:860)
    dotty.tools.dotc.core.classfile.ClassfileParser.unpickleOrParseInnerClasses(ClassfileParser.scala:966)
    dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:165)
    dotty.tools.dotc.core.classfile.ClassfileParser.run$$anonfun$1(ClassfileParser.scala:87)
    dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:82)
    dotty.tools.dotc.core.ClassfileLoader.load(SymbolLoaders.scala:414)
    dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:409)
    dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:343)
    dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
    dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
    dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
    dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
    dotty.tools.dotc.core.SymDenotations$SymDenotation.flags(SymDenotations.scala:65)
    dotty.tools.dotc.core.SymDenotations$SymDenotation.is(SymDenotations.scala:106)
    dotty.tools.dotc.sbt.ExtractDependencies.recordDependency(ExtractDependencies.scala:156)
    dotty.tools.dotc.sbt.ExtractDependencies.run$$anonfun$4(ExtractDependencies.scala:100)
    scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
    scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
    scala.collection.mutable.HashSet$Node.foreach(HashSet.scala:435)
    scala.collection.mutable.HashSet.foreach(HashSet.scala:361)
    dotty.tools.dotc.sbt.ExtractDependencies.run(ExtractDependencies.scala:100)
    dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:300)
    scala.collection.immutable.List.map(List.scala:246)
    dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:301)
    dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:185)
    scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
    scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
    scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
    dotty.tools.dotc.Run.runPhases$5(Run.scala:195)
    dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:203)
    scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
    dotty.tools.dotc.Run.compileUnits(Run.scala:210)
    dotty.tools.dotc.Run.compileSources(Run.scala:146)
    dotty.tools.dotc.Run.compile(Run.scala:130)
    dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
    dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88)
    dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
    sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:92)
    sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:186)
    scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
    sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:241)
    sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:176)
    sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:157)
    sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
    sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:157)
    sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:204)
    sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:573)
    sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:573)
    sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:174)
    sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:172)
    sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:459)
    sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
    sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
    sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
    sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:261)
    sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:414)
    sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:499)
    sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:401)
    sbt.internal.inc.Incremental$.apply(Incremental.scala:166)
    sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:573)
    sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:491)
    sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
    sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:420)
    sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
    sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2177)
    sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2134)
    sbt.internal.io.Retry$.apply(Retry.scala:40)
    sbt.internal.io.Retry$.apply(Retry.scala:23)
    sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:31)
    sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2130)
    scala.Function1.$anonfun$compose$1(Function1.scala:49)
    sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
    sbt.std.Transform$$anon$4.work(Transform.scala:68)
    sbt.Execute.$anonfun$submit$2(Execute.scala:282)
    sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
    sbt.Execute.work(Execute.scala:291)
    sbt.Execute.$anonfun$submit$1(Execute.scala:282)
    sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
    sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
    java.util.concurrent.FutureTask.run(FutureTask.java:266)
    java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    java.util.concurrent.FutureTask.run(FutureTask.java:266)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    java.lang.Thread.run(Thread.java:748)

The imported 2.13.4 dependency is:

resolvers += Resolver.jcenterRepo
libraryDependencies += ("com.github.marcinzh" %% "turbolift-core" % "0.8.0").withDottyCompat(scalaVersion.value)
@griggt
Copy link
Contributor

griggt commented Jan 20, 2021

A minimized standalone reproducer:

Scala 2

// s2/Lib.scala

package i11173

trait DU[A, B]
trait H[F[_]]

trait Foo[E] {
  def foo: H[({type L[A] = DU[E, A]})#L]
}

trait Bar[E] extends Foo[E] {
  def bar = foo   // important note: return type not specified
}

Scala 3

// s3/Main.scala

import i11173.Bar

def test(x: Bar[_]): Unit = ()

These may be compiled using the following build.sbt:

lazy val s2 = project.in(file("s2"))
  .settings(scalaVersion := "2.13.4")

lazy val s3 = project.in(file("s3"))
  .dependsOn(s2)
  .settings(scalaVersion := "3.0.0-RC1-bin-20210117-65b17af-NIGHTLY")

or directly on the command line:

$ scalac -version
Scala compiler version 2.13.4 -- Copyright 2002-2020, LAMP/EPFL and Lightbend, Inc.

$ dotc -version
Scala compiler version 3.0.0-RC1-bin-SNAPSHOT-git-cc8ffb1 -- Copyright 2002-2021, LAMP/EPFL

$ scalac s2/Lib.scala && dotc s3/Main.scala
Compiler output - click to expand
exception caught when loading trait Bar: java.lang.AssertionError: assertion failed: duplicate type E#4433; previous was type E#4426
exception occurred while typechecking s3/Main.scala
exception occurred while compiling s3/Main.scala
java.lang.AssertionError: assertion failed: duplicate type E#4433; previous was type E#4426 while compiling s3/Main.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: duplicate type E#4433; previous was type E#4426
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Scopes$MutableScope.enter(Scopes.scala:275)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enterNoReplace(SymDenotations.scala:1867)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enter(SymDenotations.scala:1858)
	at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.finishSym$1(Scala2Unpickler.scala:493)
	at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readDisambiguatedSymbol(Scala2Unpickler.scala:546)
	at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readSymbol(Scala2Unpickler.scala:327)
	at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.run(Scala2Unpickler.scala:182)
	at dotty.tools.dotc.core.classfile.ClassfileParser.unpickleScala$1(ClassfileParser.scala:860)
	at dotty.tools.dotc.core.classfile.ClassfileParser.unpickleOrParseInnerClasses(ClassfileParser.scala:966)
	at dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:165)
	at dotty.tools.dotc.core.classfile.ClassfileParser.run$$anonfun$1(ClassfileParser.scala:87)
	at dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:82)
	at dotty.tools.dotc.core.ClassfileLoader.load(SymbolLoaders.scala:414)
	at dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:409)
	at dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:343)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeOnce(SymDenotations.scala:361)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.isAbsent(SymDenotations.scala:570)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.isAccessibleFrom(SymDenotations.scala:863)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.accessibleFrom(Denotations.scala:613)
	at dotty.tools.dotc.typer.Typer.selection$3(Typer.scala:213)
	at dotty.tools.dotc.typer.Typer.recur$1(Typer.scala:247)
	at dotty.tools.dotc.typer.Typer.namedImportRef$1(Typer.scala:254)
	at dotty.tools.dotc.typer.Typer.loop$1(Typer.scala:393)
	at dotty.tools.dotc.typer.Typer.findRefRecur$1(Typer.scala:415)
	at dotty.tools.dotc.typer.Typer.findRef(Typer.scala:418)
	at dotty.tools.dotc.typer.Typer.typedIdent(Typer.scala:473)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2521)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2613)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2679)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2683)
	at dotty.tools.dotc.typer.Typer.typedAppliedTypeTree(Typer.scala:1766)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2578)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2614)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2679)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2683)
	at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:1300)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1292)
	at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:1300)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1512)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:699)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:830)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:731)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2494)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2519)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2613)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2679)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2683)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1305)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1292)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1305)
	at dotty.tools.dotc.typer.Namer.completeParams$$anonfun$1(Namer.scala:1321)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at dotty.tools.dotc.typer.Namer.completeParams(Namer.scala:1321)
	at dotty.tools.dotc.typer.Namer.defDefSig$$anonfun$3(Namer.scala:1550)
	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.typer.Namer.defDefSig(Namer.scala:1550)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:703)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:830)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:731)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2494)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2519)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2613)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2679)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2683)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2705)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2755)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2202)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2540)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2544)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2613)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2679)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2683)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2705)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2755)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2337)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2585)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2614)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2679)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2683)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2799)
	at dotty.tools.dotc.typer.FrontEnd.liftedTree1$1(FrontEnd.scala:79)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:84)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:43)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:85)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:120)
	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.typer.FrontEnd.runOn(FrontEnd.scala:120)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:185)
	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$5(Run.scala:195)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:203)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:210)
	at dotty.tools.dotc.Run.compileSources(Run.scala:146)
	at dotty.tools.dotc.Run.compile(Run.scala:130)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
	at dotty.tools.dotc.Driver.process(Driver.scala:186)
	at dotty.tools.dotc.Driver.process(Driver.scala:155)
	at dotty.tools.dotc.Driver.process(Driver.scala:167)
	at dotty.tools.dotc.Driver.main(Driver.scala:194)
	at dotty.tools.dotc.Main.main(Main.scala)

@smarter smarter removed their assignment Jan 20, 2021
@valdo404
Copy link

valdo404 commented Mar 3, 2021

Another example of failure would be with the following main.scala code:

package com.powerspace.dns

import cats.effect.{Resource, IO}

object app:
  def main(args: Array[String]): Unit =
    val clientResource = Resource.make[IO, DefaultKubernetesClient](
      IO(DefaultKubernetesClient(Config())))(client => IO.delay(???))

case class DefaultKubernetesClient(config: Config)
case class Config()

And the following build.sbt

name := "domain-management"

version := "0.1"

scalaVersion := "3.0.0-RC1"
scalacOptions += "-Ytasty-reader"

libraryDependencies += ("co.fs2" % "fs2-core_2.13" % "3.0.0-M9").withDottyCompat(scalaVersion.value)

The code portion which is triggering the error is Resource.make[IO, DefaultKubernetesClient] which is failing with the following assert error:

[error] ## Exception when compiling 1 sources to /Users/lvaldes/Projects/domain-management/target/scala-3.0.0-RC1/classes
[error] java.lang.AssertionError: assertion failed: duplicate type F#29860; previous was type F#29662
[error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
[error] dotty.tools.dotc.core.Scopes$MutableScope.enter(Scopes.scala:275)
[error] dotty.tools.dotc.core.SymDenotations$ClassDenotation.enterNoReplace(SymDenotations.scala:1868)
[error] dotty.tools.dotc.core.SymDenotations$ClassDenotation.enter(SymDenotations.scala:1859)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.finishSym$1(Scala2Unpickler.scala:493)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readDisambiguatedSymbol(Scala2Unpickler.scala:546)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readSymbol(Scala2Unpickler.scala:327)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.run(Scala2Unpickler.scala:182)
[error] dotty.tools.dotc.core.classfile.ClassfileParser.unpickleScala$1(ClassfileParser.scala:866)
[error] dotty.tools.dotc.core.classfile.ClassfileParser.unpickleOrParseInnerClasses(ClassfileParser.scala:969)
[error] dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:165)
[error] dotty.tools.dotc.core.classfile.ClassfileParser.run$$anonfun$1(ClassfileParser.scala:87)
[error] dotty.tools.dotc.core.classfile.ClassfileParser$$Lambda$7789/0x00000000bbb5ea20.apply(Unknown Source)
[error] dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:82)
[error] dotty.tools.dotc.core.ClassfileLoader.load(SymbolLoaders.scala:414)
[error] dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:409)
[error] dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:343)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.completeOnce(SymDenotations.scala:361)
[error] dotty.tools.dotc.core.SymDenotations$SymDenotation.unforcedDecls(SymDenotations.scala:385)
[error] dotty.tools.dotc.core.SymDenotations$ClassDenotation.typeParamsFromDecls(SymDenotations.scala:1706)
[error] dotty.tools.dotc.core.SymDenotations$ClassDenotation.typeParams(SymDenotations.scala:1719)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readType(Scala2Unpickler.scala:777)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readTypeRef$$anonfun$1(Scala2Unpickler.scala:896)
[error] dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$$Lambda$8042/0x00000000bb2ce420.apply(Unknown Source)

@felixbr
Copy link

felixbr commented Mar 19, 2021

Hi, I also encountered this issue and tried to make a very minimal but executable repro-case: https://github.com/felixbr/repro-case-11173

Hope this helps.

Cheers
~ Felix

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