Scala Programming Language
  1. Scala Programming Language
  2. SI-8004

Call of applyDynamicNamed results in NoPosition error

    Details

      Description

      A call of an applyDynamicNamed results in a NoPosition error:

      object X {
        val d = new D
        d.meth(value1 = 10, value2 = 100)
        d(value1 = 10)
      }
      import language.dynamics
      class D extends Dynamic {
        def applyDynamicNamed(name: String)(value: (String, Any)*) = name
      }
      

      Compiled with scalac -Yrangepos -Xprint-pos -Xprint:typer -Ystop-after:typer x.scala:

      ======= Position error
      Unpositioned tree #467
         unpositioned [L  -1 P#  472] #467    [NoPosition]    Apply      // Apply(method apply)
            enclosing [L   3        ] #472    [29:62]         Apply      // (value1 = 10, value2 = 100)
              sibling [L   3 P#  472] #432    [29:30]         Apply      // d.
              sibling [L  -1 P#  472] #467    [NoPosition]    Apply      // Apply(method apply)
              sibling [L  -1 P#  472] #471    [NoPosition]    Apply      // Apply(method apply)
      
      While validating #539
      [L   1        ] #539    [0:202]         PackageDef // object X {
      
      Children:
        [L   1 P#  539] #113    [0:0]           Ident      // o
        [L   1 P#  539] #491    [0:81]          ModuleDef  // X {
        [L   6 P#  539] #494    [82:106]        Import     // language.dynamics
        [L   7 P#  539] #538    [107:202]       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: TypeTree(class String)
                    symbol: class String in package lang (flags: final <java>)
         symbol definition: final class String extends Serializable with Comparable[String] with CharSequence
                       tpe: String
             symbol owners: class String -> package lang
            context owners: value value -> method applyDynamicNamed -> class D -> package <empty>
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Simon Schäfer
            Reporter:
            Simon Schäfer
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development