Skip to content

ICE: java.lang.AssertionError: assertion failed: invalid prefix HKTypeLambda(List(T), ...,List(TypeParamRef(T)))), at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:2043) #12448

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

Closed
chengniansun opened this issue May 12, 2021 · 1 comment · Fixed by #16291
Assignees
Labels
backlog No work planned on this by the core team for the time being. fuzzball itype:bug itype:crash
Milestone

Comments

@chengniansun
Copy link

Compiler Version

Scala compiler version 3.0.1-RC1-bin-SNAPSHOT-git-4410752 -- Copyright 2002-2021, LAMP/EPFL

System Information

Linux 5.4.0-66-generic x86_64 GNU/Linux

Minimized Code

object Main {
  def mkArray[T <: A]: T#AType
  mkArray[Array]
}

Output (click arrow to expand)

-- [E006] Not Found Error: mutant.scala:2:19 -------------------------------------------------------------------------------
2 |  def mkArray[T <: A]: T#AType
  |                   ^
  |                   Not found: type A

longer explanation available when compiling with `-explain`
-- [E067] Syntax Error: mutant.scala:2:6 -----------------------------------------------------------------------------------
2 |  def mkArray[T <: A]: T#AType
  |      ^
  |      Declaration of method mkArray not allowed here: only classes can have declared but undefined members
exception occurred while typechecking mutant.scala
exception occurred while compiling mutant.scala
java.lang.AssertionError: assertion failed: invalid prefix HKTypeLambda(List(T), List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Any))), AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),class Array),List(TypeParamRef(T)))) while compiling mutant.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: invalid prefix HKTypeLambda(List(T), List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Any))), AppliedType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object scala),class Array),List(TypeParamRef(T))))
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:2043)
	at dotty.tools.dotc.core.Types$TypeRef.<init>(Types.scala:2613)
	at dotty.tools.dotc.core.Types$CachedTypeRef.<init>(Types.scala:2669)
	at dotty.tools.dotc.core.Uniques$NamedTypeUniques.newType$1(Uniques.scala:43)
	at dotty.tools.dotc.core.Uniques$NamedTypeUniques.enterIfNew(Uniques.scala:53)
	at dotty.tools.dotc.core.Types$TypeRef$.apply(Types.scala:2728)
	at dotty.tools.dotc.core.Types$NamedType$.apply(Types.scala:2704)
	at dotty.tools.dotc.core.Types$NamedType.withPrefix(Types.scala:2548)
	at dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:2480)
	at dotty.tools.dotc.core.Substituters$.substParams(Substituters.scala:154)
	at dotty.tools.dotc.core.Types$Type.substParams(Types.scala:1742)
	at dotty.tools.dotc.core.Types$LambdaType.instantiate(Types.scala:3339)
	at dotty.tools.dotc.core.Types$LambdaType.instantiate$(Types.scala:3300)
	at dotty.tools.dotc.core.Types$MethodOrPoly.instantiate(Types.scala:3380)
	at dotty.tools.dotc.typer.TypeAssigner.assignType(TypeAssigner.scala:346)
	at dotty.tools.dotc.typer.TypeAssigner.assignType$(TypeAssigner.scala:19)
	at dotty.tools.dotc.typer.Typer.assignType(Typer.scala:106)
	at dotty.tools.dotc.typer.Applications.typedTypeApply(Applications.scala:1089)
	at dotty.tools.dotc.typer.Applications.typedTypeApply$(Applications.scala:303)
	at dotty.tools.dotc.typer.Typer.typedTypeApply(Typer.scala:106)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2704)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2748)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2866)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2889)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2344)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2673)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2677)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2747)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2839)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2889)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2467)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2718)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2748)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2813)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2817)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2933)
	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:205)
	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:216)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:224)
	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:231)
	at dotty.tools.dotc.Run.compileSources(Run.scala:166)
	at dotty.tools.dotc.Run.compile(Run.scala:150)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
	at dotty.tools.dotc.Driver.process(Driver.scala:199)
	at dotty.tools.dotc.Driver.process(Driver.scala:167)
	at dotty.tools.dotc.Driver.process(Driver.scala:179)
	at dotty.tools.dotc.Driver.main(Driver.scala:209)
	at dotty.tools.dotc.Main.main(Main.scala)
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 8, 2022
@odersky odersky added the backlog No work planned on this by the core team for the time being. label Apr 9, 2022
@griggt griggt closed this as completed in bb29040 Apr 10, 2022
@griggt
Copy link
Contributor

griggt commented Apr 10, 2022

Not fixed yet, see #14889 (comment)

@griggt griggt reopened this Apr 10, 2022
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 25, 2022
@dwijnand dwijnand linked a pull request Nov 7, 2022 that will close this issue
@dwijnand dwijnand self-assigned this Nov 7, 2022
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog No work planned on this by the core team for the time being. fuzzball itype:bug itype:crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants