diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/existential-rangepos.check | 6 | ||||
-rw-r--r-- | test/files/run/position-val-def.check | 30 | ||||
-rw-r--r-- | test/files/run/position-val-def.scala | 26 | ||||
-rw-r--r-- | test/files/run/t5064.check | 8 | ||||
-rw-r--r-- | test/files/run/t5385.check | 16 | ||||
-rw-r--r-- | test/files/run/t5603.check | 26 | ||||
-rw-r--r-- | test/files/run/t6288.check | 6 | ||||
-rw-r--r-- | test/files/run/t6768.check | 12 | ||||
-rw-r--r-- | test/files/run/t6768.scala | 12 | ||||
-rw-r--r-- | test/files/run/t7271.check | 2 |
10 files changed, 88 insertions, 56 deletions
diff --git a/test/files/run/existential-rangepos.check b/test/files/run/existential-rangepos.check index f426c6471f..1212b60bae 100644 --- a/test/files/run/existential-rangepos.check +++ b/test/files/run/existential-rangepos.check @@ -1,13 +1,13 @@ [[syntax trees at end of patmat]] // newSource1.scala [0:76]package [0:0]<empty> { - [15/0:76]abstract class A[[17:18]T[17:18]] extends [20:76][76]scala.AnyRef { + [0:76]abstract class A[[17:18]T[17:18]] extends [20:76][76]scala.AnyRef { [76]def <init>(): [20]A[T] = [76]{ [76][76][76]A.super.<init>(); [20]() }; - [28:51]private[this] val foo: [28]Set[_ <: T] = [47:51]null; + [24:51]private[this] val foo: [28]Set[_ <: T] = [47:51]null; [28]<stable> <accessor> def foo: [28]Set[_ <: T] = [28][28]A.this.foo; - [58:74]<stable> <accessor> def bar: [58]Set[_ <: T] + [54:74]<stable> <accessor> def bar: [58]Set[_ <: T] } } diff --git a/test/files/run/position-val-def.check b/test/files/run/position-val-def.check new file mode 100644 index 0000000000..a92c77c68c --- /dev/null +++ b/test/files/run/position-val-def.check @@ -0,0 +1,30 @@ +val x = 0 +[0:9]val x = [8:9]0 + +var x = 0 +[0:9]var x = [8:9]0 + +val x, y = 0 +[NoPosition]{ + [0:5]val x = [11]0; + [7:12]val y = [11:12]0; + [NoPosition]() +} + +var x, y = 0 +[NoPosition]{ + [0:5]var x = [11]0; + [7:12]var y = [11:12]0; + [NoPosition]() +} + +val (x, y) = 0 +[NoPosition]{ + <0:14><synthetic> <artifact> private[this] val x$1 = <4:14>[13:14][13:14]0: @[13]scala.unchecked match { + <4:10>case <4:10>[4]scala.Tuple2(<5:6>(x @ [5]_), <8:9>(y @ [8]_)) => <4:10><4:10>scala.Tuple2(<4:10>x, <4:10>y) + }; + [5:6]val x = [5]x$1._1; + [8:9]val y = [8]x$1._2; + [NoPosition]() +} + diff --git a/test/files/run/position-val-def.scala b/test/files/run/position-val-def.scala new file mode 100644 index 0000000000..62cb54acf8 --- /dev/null +++ b/test/files/run/position-val-def.scala @@ -0,0 +1,26 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test { + val toolbox = cm.mkToolBox(options = "-Yrangepos") + + def main(args: Array[String]) { + def test(expr: String) { + val t = toolbox.parse(expr) + println(expr) + println(show(t, printPositions = true)) + println() + } + val tests = """ + val x = 0 + var x = 0 + val x, y = 0 + var x, y = 0 + val (x, y) = 0 + """ + val exprs = tests.split("\\n").map(_.trim).filterNot(_.isEmpty) + exprs foreach test + } +} diff --git a/test/files/run/t5064.check b/test/files/run/t5064.check index 7b92e40c35..61ccfd16e7 100644 --- a/test/files/run/t5064.check +++ b/test/files/run/t5064.check @@ -1,19 +1,19 @@ [53] T5064.super.<init>() [53] T5064.super.<init> [53] this -[20/16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1})) +[16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1})) [16:20] immutable.this.List.apply <16:20> immutable.this.List <16:20> immutable.this -[20/16:23] scala.this.Predef.wrapIntArray(Array[Int]{1}) +[16:23] scala.this.Predef.wrapIntArray(Array[Int]{1}) [20] scala.this.Predef.wrapIntArray [20] scala.this.Predef [20] scala.this -[29/26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1})) +[26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1})) [26:29] collection.this.Seq.apply <26:29> collection.this.Seq <26:29> collection.this -[29/26:32] scala.this.Predef.wrapIntArray(Array[Int]{1}) +[26:32] scala.this.Predef.wrapIntArray(Array[Int]{1}) [29] scala.this.Predef.wrapIntArray [29] scala.this.Predef [29] scala.this diff --git a/test/files/run/t5385.check b/test/files/run/t5385.check index f56464facd..1df74fcfb5 100644 --- a/test/files/run/t5385.check +++ b/test/files/run/t5385.check @@ -1,8 +1,8 @@ -[6/0:9] class Azz -[6/0:9] class Bzz -[6/0:9] class Czz -[6/0:9] class Dzz -[6/0:11] class Ezz -[6/0:11] class Fzz -[6/0:13] class Gzz -[6/0:13] class Hzz +[0:9] class Azz +[0:9] class Bzz +[0:9] class Czz +[0:9] class Dzz +[0:11] class Ezz +[0:11] class Fzz +[0:13] class Gzz +[0:13] class Hzz diff --git a/test/files/run/t5603.check b/test/files/run/t5603.check index 46fcdd4470..188f39ff82 100644 --- a/test/files/run/t5603.check +++ b/test/files/run/t5603.check @@ -1,29 +1,29 @@ [[syntax trees at end of parser]] // newSource1.scala [0:241]package [0:0]<empty> { - [6/0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef { + [0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef { [15]def $init$() = [15]{ [15]() }; - [27:39]val name: [33:39]String; - [50:76]val msg = [71/56:76][71/56:72][56:71]"How are you, ".$plus([72:76]name) + [23:39]val name: [33:39]String; + [46:76]val msg = [56:76][56:72][56:71]"How are you, ".$plus([72:76]name) }; - [93/87:209]class C extends [94:209][151:159]Greeting { - [123:139]val nameElse = _; + [87:209]class C extends [94:209][151:159]Greeting { + [119:139]val nameElse = _; [95:101]<paramaccessor> private[this] val i: [98:101]Int = _; - <123:139>def <init>([95]i: [98]Int) = <123:139>{ - <123:139>val nameElse = <134:139>"Bob"; - [X][X][X]super.<init>(); + <119:139>def <init>([95]i: [98]Int) = <119:139>{ + <119:139>val nameElse = <134:139>"Bob"; + [NoPosition][NoPosition][NoPosition]super.<init>(); [94]() }; - [172:184]val name = [179:184]"avc"; - [198/191:203][191:198]println([199:202]msg) + [168:184]val name = [179:184]"avc"; + [191:203][191:198]println([199:202]msg) }; - [222/215:241]object Test extends [227:241][235:238]App { + [215:241]object Test extends [227:241][235:238]App { [227]def <init>() = [227]{ - [X][X][X]super.<init>(); + [NoPosition][NoPosition][NoPosition]super.<init>(); [227]() }; - [X]<empty> + [NoPosition]<empty> } } diff --git a/test/files/run/t6288.check b/test/files/run/t6288.check index 0da03c0439..a032a10de6 100644 --- a/test/files/run/t6288.check +++ b/test/files/run/t6288.check @@ -18,7 +18,7 @@ [64]case6(){ [64][64]matchEnd4([64]throw [64][64][64]new [64]MatchError([64]x1)) }; - [64]matchEnd4(x: [X]Unit){ + [64]matchEnd4(x: [NoPosition]Unit){ [64]x } } @@ -44,7 +44,7 @@ [175]case6(){ [175][175]matchEnd4([175]throw [175][175][175]new [175]MatchError([175]x1)) }; - [175]matchEnd4(x: [X]Unit){ + [175]matchEnd4(x: [NoPosition]Unit){ [175]x } } @@ -70,7 +70,7 @@ [273]case6(){ [273][273]matchEnd4([273]throw [273][273][273]new [273]MatchError([273]x1)) }; - [273]matchEnd4(x: [X]Unit){ + [273]matchEnd4(x: [NoPosition]Unit){ [273]x } } diff --git a/test/files/run/t6768.check b/test/files/run/t6768.check deleted file mode 100644 index 64df4568ec..0000000000 --- a/test/files/run/t6768.check +++ /dev/null @@ -1,12 +0,0 @@ -[[syntax trees at end of typer]] // newSource1.scala -[1:58]package [1:1]<empty> { - [7/1:58]class A extends [9:58][58]scala.AnyRef { - [58]def <init>(): [9]A = [58]{ - [58][58][58]A.super.<init>(); - [9]() - }; - [17/13:31]def f1: [17]Some[String] = [26/22:31][22:26][22:26]scala.Some.apply[[22]String]([27:30]"a"); - [38/34:56]def f2: [38]Some[String] = [47/43:56][47:51][47:51]new [47:51]<type: [47:51]scala.Some>([52:55]"b") - } -} - diff --git a/test/files/run/t6768.scala b/test/files/run/t6768.scala deleted file mode 100644 index 11470a0ef8..0000000000 --- a/test/files/run/t6768.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.tools.partest._ - -object Test extends DirectTest { - override def extraSettings: String = "-usejavacp -Xprint:typer -Yrangepos -Xprint-pos -d " + testOutput.path - override def show() = Console.withErr(System.out)(compile()) - - override def code = """ -class A { - def f1 = Some("a") - def f2 = new Some("b") -}""" -} diff --git a/test/files/run/t7271.check b/test/files/run/t7271.check index 86b5230fd7..f7a23018ca 100644 --- a/test/files/run/t7271.check +++ b/test/files/run/t7271.check @@ -2,7 +2,7 @@ [6]package [6]<empty> { [6]class C extends [8][91]scala.AnyRef { [8]def <init>() = [8]{ - [X][X][X]super.<init>(); + [NoPosition][NoPosition][NoPosition]super.<init>(); [8]() }; [20]def quote = [28][28][28][28]StringContext([30]"foo", [40]"baz").s([35]this); |