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

Compiler crashes on incomplete partially applied function type signature #11909

Open
melezov opened this issue Mar 16, 2020 · 0 comments
Open

Compiler crashes on incomplete partially applied function type signature #11909

melezov opened this issue Mar 16, 2020 · 0 comments
Assignees
Milestone

Comments

@melezov
Copy link

@melezov melezov commented Mar 16, 2020

Reproducible on 2.12.10 and 2.13.1 (edit: reproducible with 2.12.11 too)

scala> def foo(a: Int, b: Int): Unit = ()
foo: (a: Int, b: Int)Unit

scala> def barOk1 = foo _
barOk1: (Int, Int) => Unit

scala> def barOk2 = foo(_, _)
barOk2: (Int, Int) => Unit

scala> def barOk3 = foo(_: Int, _: Int)
barOk3: (Int, Int) => Unit

scala> def barError = foo(_: Int, _)
java.lang.NullPointerException
        at scala.reflect.internal.Types$TypeRef.computeHashCode(Types.scala:2115)
        at scala.reflect.internal.Types$UniqueType.<init>(Types.scala:1084)
        at scala.reflect.internal.Types$TypeRef.<init>(Types.scala:2077)
        at scala.reflect.internal.Types$ArgsTypeRef.<init>(Types.scala:1837)
        at scala.reflect.internal.Types$ClassArgsTypeRef.<init>(Types.scala:2406)
        at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2416)
        at scala.reflect.internal.Types.copyTypeRef(Types.scala:3642)
        at scala.reflect.internal.Types.copyTypeRef$(Types.scala:3634)
        at scala.reflect.internal.SymbolTable.copyTypeRef(SymbolTable.scala:28)
        at scala.reflect.internal.Types.appliedType(Types.scala:3718)
        at scala.reflect.internal.Types.appliedType$(Types.scala:3703)
        at scala.reflect.internal.SymbolTable.appliedType(SymbolTable.scala:28)
        at scala.reflect.internal.Types.appliedType(Types.scala:3736)
        at scala.reflect.internal.Types.appliedType$(Types.scala:3735)
        at scala.reflect.internal.SymbolTable.appliedType(SymbolTable.scala:28)
        at scala.reflect.internal.Definitions$DefinitionsClass$VarArityClass.specificType(Definitions.scala:607)
        at scala.reflect.internal.Definitions$DefinitionsClass.functionType(Definitions.scala:625)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedFunctionUndoingEtaExpansion$6(Typers.scala:3133)
        at scala.tools.nsc.typechecker.Typers$Typer.typedFunctionUndoingEtaExpansion(Typers.scala:72)
        at scala.tools.nsc.typechecker.Typers$Typer.typedFunction(Typers.scala:3029)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$101(Typers.scala:5611)
        at scala.tools.nsc.typechecker.Typers$Typer.typedFunction$1(Typers.scala:499)
        at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5648)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5680)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5716)
        at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:5791)
        at scala.tools.nsc.typechecker.Namers$Namer.assignTypeToTree(Namers.scala:1099)
        at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1444)
        at scala.tools.nsc.typechecker.Namers$Namer.memberSig(Namers.scala:1892)
        at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1858)
        at scala.tools.nsc.typechecker.Namers$Namer$MonoTypeCompleter.completeImpl(Namers.scala:862)
        at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter.complete(Namers.scala:2055)
        at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter.complete$(Namers.scala:2053)
        at scala.tools.nsc.typechecker.Namers$TypeCompleterBase.complete(Namers.scala:2048)
        at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1542)
        at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1690)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5339)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5716)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5780)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2013)
        at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1879)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5637)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5716)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5780)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2013)
        at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1879)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5637)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5716)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5780)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2013)
        at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1879)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5637)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5716)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5780)
        at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3353)
        at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5346)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5639)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5716)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:114)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:453)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:103)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1503)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1480)
        at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:440)
        at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:812)
        at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:770)
        at scala.tools.nsc.interpreter.IMain$Request.compile$lzycompute(IMain.scala:971)
        at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:966)
        at scala.tools.nsc.interpreter.IMain.compile(IMain.scala:609)
        at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:598)
        at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:570)
        at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:894)
        at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:762)
        at scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:464)
        at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:485)
        at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:1077)
        at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:89)
        at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:92)
        at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:103)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@SethTisue SethTisue added this to the Backlog milestone Mar 16, 2020
@hrhino hrhino self-assigned this Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.