We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A call of an updateDynamic method results in a NoPosition error:
updateDynamic
object X { val d = new D d.field = 10 d.field } import language.dynamics class D extends Dynamic { var map = Map.empty[String, Any] def selectDynamic(name: String) = map(name) def updateDynamic(name: String)(value: Any) { map += name -> value } }
Compiled with scalac -Yrangepos -Xprint-pos -Xprint:typer -Ystop-after:typer x.scala:
scalac -Yrangepos -Xprint-pos -Xprint:typer -Ystop-after:typer x.scala
======= Position error Unpositioned tree #448 unpositioned [L -1 P# 478] #448 [NoPosition] Apply // Apply(method updateDynamic) enclosing [L 1 ] #478 [9:53] Template // { sibling [L 6 P# 478] #59 [54] Select // Select(Ident(scala), AnyRef) sibling [L -1 P# 478] #41 [NoPosition] emptyValDef // term _ sibling [L 1 P# 478] #67 [9] DefDef // term <init> sibling [L 2 P# 478] #282 [13:26] ValDef // d = new D sibling [L 2 P# 478] #286 [17] DefDef // term d sibling [L -1 P# 478] #448 [NoPosition] Apply // Apply(method updateDynamic) sibling [L 4 P# 478] #453 [44:45] Apply // d. While validating #570 [L 1 ] #570 [0:268] PackageDef // object X { Children: [L 1 P# 570] #120 [0:0] Ident // o [L 1 P# 570] #479 [0:53] ModuleDef // X { [L 6 P# 570] #482 [54:78] Import // language.dynamics [L 7 P# 570] #569 [79:268] ClassDef // D extends Dynamic { ======= error: while compiling: x.scala during phase: typer library version: version 2.10.1 compiler version: version 2.10.1 reconstructed args: -Yrangepos -Xprint-pos -Xprint:typer -Ystop-after:typer last tree to typer: Apply(method ->) symbol: method -> in class ArrowAssoc (flags: <method> <triedcooking>) symbol definition: def ->[B](y: B): (A, B) tpe: (String, Any) symbol owners: method -> -> class ArrowAssoc -> object Predef -> package scala context owners: method updateDynamic -> class D -> package <empty>
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-8005?orig=1 Reporter: @sschaef Affected Versions: 2.11.0 Other Milestones: 2.11.0-M8
Sorry, something went wrong.
kiritsuku
No branches or pull requests
A call of an
updateDynamic
method results in a NoPosition error:Compiled with
scalac -Yrangepos -Xprint-pos -Xprint:typer -Ystop-after:typer x.scala
:The text was updated successfully, but these errors were encountered: