Aladdin - Scala Bugtracking
[#556] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Gilles Martin fixed 2006-03-23 16:14:59.0
subject Crash when function parameter has wrong number of arguments
code
object Main extends Application {
  def f(a:Int=>Int):Int = a(4)
  def g:Int = f((x,y)=>x)
}
what happened
Exception in thread "main" java.lang.Error: unexpected tree: 
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1546)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1556)
        at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:1602)
        at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:685)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$39.apply(Typers.scala:907)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$39.apply(Typers.scala:907)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.typechecker.Typers$Typer.typedFunction(Typers.scala:907)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1319)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1556)
        at scala.tools.nsc.typechecker.Typers$Typer.typedArg$0(Typers.scala:990)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1010)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$47.apply(Typers.scala:1010)
        at scala.List$.map2(List.scala:265)
        at scala.tools.nsc.typechecker.Typers$Typer.typedApply$0(Typers.scala:1010)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1441)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1556)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1586)
        at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:1620)
        at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:801)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1241)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1556)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1582)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:943)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:933)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.List$.loop$0(List.scala:236)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:933)
        at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:676)
        at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:625)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1235)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1556)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1582)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:943)
        at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:933)
        at scala.List$.loop$0(List.scala:232)
        at scala.List$.mapConserve(List.scala:249)
        at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:933)
        at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1228)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1556)
        at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1582)
        at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:39)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:208)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:197)
        at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:197)
        at scala.Iterator$class.foreach(Iterator.scala:285)
        at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:216)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:197)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:422)
        at scala.tools.nsc.Global$Run.compile(Global.scala:480)
        at scala.tools.nsc.Main$.process(Main.scala:60)
        at scala.tools.nsc.Main$.main(Main.scala:80)
        at scala.tools.nsc.Main.main(Main.scala)
what expected A sensible error message
[back to overview]
Changes of this bug report
Martin  edited on  2006-03-27 22:26:30.0