forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw some wrappingPos on the result of dyna.mkInvoke.
The result is more accurate positions for some dynamics, as can be seen in the diffs for `run/dynamic-*.scala`, and less crashy positions for others, as can be seen in the attached new test case. Fixes scala/bug#10203.
- Loading branch information
Showing
7 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[[syntax trees at end of typer]] // newSource1.scala | ||
[0:88]package [0:0]<empty> { | ||
[0:88]object X extends [9:88][88]scala.AnyRef { | ||
[88]def <init>(): [9]X.type = [88]{ | ||
[88][88][88]X.super.<init>(); | ||
[9]() | ||
}; | ||
[17:24][17:18][17:18]D.selectDynamic[[17]Nothing](<19:24>"aaaaa"); | ||
[31:42][31:42][31:32]D.selectDynamic[[39:42]<type: [39:42]scala.Int>](<33:38>"sssss"); | ||
[50:60][50:57][50:51][50:51]D.applyDynamic[[50]Int](<52:57>"ddddd")([58:59]1); | ||
[67:82][67:78][67:78][67:68]D.applyDynamic[[75:78]<type: [75:78]scala.Int>](<69:74>"fffff")([80:81]1) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import scala.tools.partest.DirectTest | ||
|
||
object Test extends DirectTest { | ||
|
||
override def extraSettings: String = | ||
s"-usejavacp -Xprint-pos -Xprint:typer -Yrangepos -Ystop-after:typer -d ${testOutput.path}" | ||
|
||
override def code = """ | ||
object X { | ||
D.aaaaa | ||
D.sssss[Int] | ||
D.ddddd(1) | ||
D.fffff[Int](1) | ||
} | ||
""".trim | ||
|
||
override def show(): Unit = { | ||
Console.withErr(System.out) { | ||
compile() | ||
} | ||
} | ||
} | ||
|
||
import language.dynamics | ||
object D extends Dynamic { | ||
def selectDynamic[T](nme: String): String = ??? | ||
def applyDynamic[T](name: String)(value: T) = ??? | ||
} |