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
scala compiler NullPointerException at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1131) #7001
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7001?orig=1
|
Oleksandr Vayda (wajda) said: Any guess what syntactic construction can cause it, so I could perhaps work it around somehow?
|
Oleksandr Vayda (wajda) said (edited on Jan 24, 2013 2:54:35 PM UTC): From the Scala perspective the code itself is wrong, so the expected behaviour of the compiler would be just to complain about the type of value passing to the argument 'b' not matching the type of the argument. def f[T](a: Int, b: Int) = ???
f(b = 1, a = "foo") The attempt to compile this code results in
|
Oleksandr Vayda (wajda) said (edited on Jan 24, 2013 2:53:33 PM UTC): |
Systematic NullPointerException inside scala compiler once I've added a new parameter (chartFactory) to a method call. If I remove the parameter from the call, it compiles and runs fine:
detailedCPUSection += newTabChartSection(
sectionTitle = s"CPU Usage for ${host}",
seriesTitle = "CPU",
seriesList = cpumetrics.map(s => s.rename(s.name, s.name)),
norm4chart = Some(_.statSample(period)),
unitdesc = "%", showRange = true, showTrend = true,
chartFactory = StackedChart // HERE
)
(StackedChart is an object).
full message attached to this issue report.
[info] Loading project definition from /home/work/experiments/Analysis/project
[info] Set current project to Analysis (in build file:/home/work/experiments/Analysis/)
[info] Compiling 5 Scala sources to /home/work/experiments/Analysis/target/scala-2.10/classes...
[error]
[error] while compiling: /home/work/experiments/Analysis/src/main/scala/com/orange/analysis/Reporting.scala
[error] during phase: typer
[error] library version: version 2.10.0
[error] compiler version: version 2.10.0
...
[error]
[error] last tree to typer: Ident(StackedChart)
[error] symbol: value in class (flags: <is_error>)
[error] symbol definition: val :
[error] tpe:
[error] symbol owners: value -> class -> package
[error] context owners: value $anonfun -> value $anonfun -> method metricsReport -> object Reporting -> package
analysis
[error]
[error] == Enclosing template or block ==
...
[error]
[error] == Expanded type of tree ==
[error]
[error]
[error]
[error] uncaught exception during compilation: java.lang.NullPointerException
java.lang.NullPointerException
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1131)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5467)
at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:2880)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3021)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$60.apply(Typers.scala:3013)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:309)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at scala.tools.nsc.typechecker.Typers$Typer.handleOverloaded$1(Typers.scala:3013)
at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3033)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$86.apply(Typers.scala:4423)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$86.apply(Typers.scala:4423)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:721)
at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:4423)
...
The text was updated successfully, but these errors were encountered: