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

Call of updateDynamic results in NoPosition error #8005

Closed
scabug opened this issue Nov 23, 2013 · 1 comment
Closed

Call of updateDynamic results in NoPosition error #8005

scabug opened this issue Nov 23, 2013 · 1 comment
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Nov 23, 2013

A call of an updateDynamic method results in a NoPosition error:

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:

======= 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>
@scabug
Copy link
Author

@scabug scabug commented Nov 23, 2013

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

@scabug scabug closed this Nov 26, 2013
@scabug scabug added this to the 2.10.4-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants