Skip to content

Crash in TypeAssigner.assignType (parser stability) #7751

@sir-wabbit

Description

@sir-wabbit

minimized code

val a = Some(a=a,)=>
val a = Some(x=y,)=>
Stack trace
-- [E018] Syntax Error: testing/Test.scala:1:17 --------------------------------
1 |val a = Some(x=y,)=>
  |                 ^
  |                 expression expected but ')' found

longer explanation available when compiling with `-explain`
-- [E018] Syntax Error: testing/Test.scala:1:20 --------------------------------
1 |val a = Some(x=y,)=>
  |                    ^
  |                    expression expected but eof found

longer explanation available when compiling with `-explain`
exception occurred while typechecking testing/Test.scala
exception occurred while compiling testing/Test.scala
java.lang.AssertionError: assertion failed while compiling testing/Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
	at dotty.tools.dotc.typer.TypeAssigner.assignType(TypeAssigner.scala:573)
	at dotty.tools.dotc.typer.Typer.assignType(Typer.scala:82)
	at dotty.tools.dotc.typer.Typer.typedAppliedTypeTree(Typer.scala:1440)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2124)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.typedTuple(Typer.scala:2022)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2134)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$3(ProtoTypes.scala:326)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:290)
	at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:326)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:797)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:797)
	at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:533)
	at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:602)
	at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:354)
	at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:694)
	at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:796)
	at dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:870)
	at dotty.tools.dotc.typer.Applications.realApply$5$$anonfun$4(Applications.scala:923)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2298)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:934)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:969)
	at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:82)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2099)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:1260)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1253)
	at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:1260)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1449)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:811)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:935)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:843)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:258)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2051)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2076)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2156)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1263)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1253)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1263)
	at dotty.tools.dotc.typer.Namer.completeParams$$anonfun$1(Namer.scala:1278)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.Namer.completeParams(Namer.scala:1278)
	at dotty.tools.dotc.typer.Namer.defDefSig$$anonfun$3(Namer.scala:1485)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1485)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:815)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:935)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:843)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:258)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2051)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2076)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2156)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2276)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:761)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:765)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2107)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.typedFunctionValue(Typer.scala:1053)
	at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:879)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2109)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1263)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1253)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1263)
	at dotty.tools.dotc.typer.Namer.rhsType$2(Namer.scala:1397)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1408)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1409)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1420)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1428)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:811)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:935)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:843)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:258)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:398)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2051)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2076)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2156)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2276)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1771)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2089)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2156)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2276)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1890)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2130)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2290)
	at dotty.tools.dotc.typer.FrontEnd.liftedTree9$2(FrontEnd.scala:78)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:83)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:42)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:84)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:114)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:114)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:161)
	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:171)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:179)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:65)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:186)
	at dotty.tools.dotc.Run.compileSources(Run.scala:123)
	at dotty.tools.dotc.Run.compile(Run.scala:106)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:36)
	at dotty.tools.dotc.Driver.process(Driver.scala:189)
	at dotty.tools.dotc.Driver.process(Driver.scala:158)
	at dotty.tools.dotc.Driver.process(Driver.scala:170)
	at dotty.tools.dotc.Driver.main(Driver.scala:197)
	at dotty.tools.dotc.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