Skip to content

Curried type parameters application crash #10679

Closed
@agluszak

Description

@agluszak

Tested with Scala 3.0.0-M2. Possibly related to #10681

Minimized code

type Curried = [X] =>> [Y] =>> String
type PartialApplication[X] = Curried[String][X]
val test1 = PartialApplication[String]                                               
val test2 = Curried[String][String]

Output (click arrow to expand)

scala> type Curried = [X] =>> [Y] =>> String                                    
     | type PartialApplication[X] = Curried[String][X]
     | val test1 = PartialApplication[String]    
// defined alias type Curried[X] = [Y] =>> String
// defined alias type PartialApplication[X] = Curried[String][X]
val test1: String = ""

scala> val test2 = Curried[String][String]                                      
Exception in thread "main" dotty.tools.dotc.ast.Trees$UnAssignedTypeException: type of dotty.tools.dotc.typer.Applications$IntegratedTypeArgs@4b41587d is not assigned
	at dotty.tools.dotc.ast.Trees$Tree.tpe(Trees.scala:79)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3572)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2932)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2601)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2605)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2720)
	at dotty.tools.dotc.typer.Applications.typedFunPart$$anonfun$1(Applications.scala:852)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2728)
	at dotty.tools.dotc.typer.Applications.typedFunPart(Applications.scala:861)
	at dotty.tools.dotc.typer.Applications.typedFunPart$(Applications.scala:236)
	at dotty.tools.dotc.typer.Typer.typedFunPart(Typer.scala:92)
	at dotty.tools.dotc.typer.Applications.typedTypeApply(Applications.scala:1078)
	at dotty.tools.dotc.typer.Applications.typedTypeApply$(Applications.scala:236)
	at dotty.tools.dotc.typer.Typer.typedTypeApply(Typer.scala:92)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2489)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2532)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2601)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2605)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1232)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1219)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1232)
	at dotty.tools.dotc.typer.Namer.rhsType$1$$anonfun$1(Namer.scala:1367)
	at dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:216)
	at dotty.tools.dotc.typer.Namer.rhsType$2(Namer.scala:1367)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1378)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1379)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1390)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1398)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:680)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:801)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:712)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:166)
	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:370)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2413)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2438)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2531)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2601)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2605)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2627)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2676)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2131)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2459)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2463)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2531)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2601)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2605)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2627)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2676)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2256)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2503)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2532)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2601)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2605)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2720)
	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.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:43)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:85)
	at dotty.tools.repl.REPLFrontEnd.runOn(ReplFrontEnd.scala:24)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:185)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.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 dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:210)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:152)
	at dotty.tools.repl.ReplCompiler.runCompilationUnit(ReplCompiler.scala:151)
	at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:161)
	at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:234)
	at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:197)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:130)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:133)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:152)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:133)
	at dotty.tools.repl.Main$.main(Main.scala:6)
	at dotty.tools.repl.Main.main(Main.scala)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions