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 applyDynamicNamed results in NoPosition error #8004

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

Call of applyDynamicNamed results in NoPosition error #8004

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

Comments

@scabug
Copy link

scabug commented Nov 23, 2013

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

scabug commented Nov 23, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8004?orig=1
Reporter: @sschaef
Affected Versions: 2.11.0
Other Milestones: 2.11.0-M8

@scabug scabug closed this as completed 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
Projects
None yet
Development

No branches or pull requests

2 participants