summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-03 09:39:56 -0800
committerPaul Phillips <paulp@improving.org>2012-02-03 09:39:56 -0800
commit7ec4ba5ea921eafb092b05f580ba7381edcd8427 (patch)
tree18d2553403b64ee683536f61b59ce62035305699 /test
parentb4cfd1161e9f549a909d9f563f557c17dbddad00 (diff)
parent58ab20ba9b6a17c81f2f89f31f7265d2ed3b166b (diff)
downloadscala-7ec4ba5ea921eafb092b05f580ba7381edcd8427.tar.gz
scala-7ec4ba5ea921eafb092b05f580ba7381edcd8427.tar.bz2
scala-7ec4ba5ea921eafb092b05f580ba7381edcd8427.zip
Merge branch 'master' into topic/inline
Diffstat (limited to 'test')
-rw-r--r--test/files/buildmanager/t2562/t2562.check10
-rw-r--r--test/files/buildmanager/t2649/t2649.check4
-rw-r--r--test/files/buildmanager/t2651_4/t2651_4.check4
-rw-r--r--test/files/buildmanager/t2652/t2652.check4
-rw-r--r--test/files/buildmanager/t2653/t2653.check2
-rw-r--r--test/files/buildmanager/t2655/t2655.check4
-rw-r--r--test/files/buildmanager/t2657/t2657.check4
-rw-r--r--test/files/buildmanager/t2789/t2789.check4
-rw-r--r--test/files/neg/checksensible.check5
-rw-r--r--test/files/neg/t5352.check13
-rw-r--r--test/files/neg/t5352.flags1
-rw-r--r--test/files/neg/t5352.scala15
-rw-r--r--test/files/neg/t5426.check13
-rw-r--r--test/files/neg/t5426.flags1
-rw-r--r--test/files/neg/t5426.scala10
-rw-r--r--test/files/neg/unicode-unterminated-quote.check4
-rw-r--r--test/files/neg/unicode-unterminated-quote.scala2
-rw-r--r--test/files/run/buffer-slice.check1
-rw-r--r--test/files/run/buffer-slice.scala5
-rw-r--r--test/files/run/code.check7
-rw-r--r--test/files/run/reify_closure1.check (renamed from test/pending/run/reify_closure1.check)0
-rw-r--r--test/files/run/reify_closure1.scala (renamed from test/pending/run/reify_closure1.scala)0
-rw-r--r--test/files/run/reify_closure2a.check (renamed from test/pending/run/reify_closure2a.check)0
-rw-r--r--test/files/run/reify_closure2a.scala (renamed from test/pending/run/reify_closure2a.scala)0
-rw-r--r--test/files/run/reify_closure3a.check (renamed from test/pending/run/reify_closure3a.check)0
-rw-r--r--test/files/run/reify_closure3a.scala (renamed from test/pending/run/reify_closure3a.scala)0
-rw-r--r--test/files/run/reify_closure4a.check (renamed from test/pending/run/reify_closure4a.check)0
-rw-r--r--test/files/run/reify_closure4a.scala (renamed from test/pending/run/reify_closure4a.scala)0
-rw-r--r--test/files/run/reify_closure5a.check (renamed from test/pending/run/reify_closure5a.check)0
-rw-r--r--test/files/run/reify_closure5a.scala (renamed from test/pending/run/reify_closure5a.scala)0
-rw-r--r--test/files/run/reify_closure6.check7
-rw-r--r--test/files/run/reify_closure6.scala (renamed from test/pending/run/reify_closure6.scala)4
-rw-r--r--test/files/run/reify_closure7.check6
-rw-r--r--test/files/run/reify_closure7.scala32
-rw-r--r--test/files/run/reify_closure8a.check1
-rw-r--r--test/files/run/reify_closure8a.scala17
-rw-r--r--test/files/run/reify_closures10.check2
-rw-r--r--test/files/run/reify_closures10.scala15
-rw-r--r--test/files/run/reify_complex.check (renamed from test/pending/run/reify_complex.check)0
-rw-r--r--test/files/run/reify_complex.scala (renamed from test/pending/run/reify_complex.scala)0
-rw-r--r--test/files/run/reify_extendbuiltins.check (renamed from test/pending/run/reify_extendbuiltins.check)0
-rw-r--r--test/files/run/reify_extendbuiltins.scala (renamed from test/pending/run/reify_extendbuiltins.scala)0
-rw-r--r--test/files/run/reify_generic2.check1
-rw-r--r--test/files/run/reify_generic2.scala16
-rw-r--r--test/files/run/reify_getter.check1
-rw-r--r--test/files/run/reify_getter.scala19
-rw-r--r--test/files/run/reify_implicits.check (renamed from test/pending/run/reify_implicits.check)0
-rw-r--r--test/files/run/reify_implicits.scala (renamed from test/pending/run/reify_implicits.scala)0
-rw-r--r--test/files/run/reify_sort.check (renamed from test/pending/run/reify_sort.check)0
-rw-r--r--test/files/run/reify_sort.scala (renamed from test/pending/run/reify_sort.scala)0
-rw-r--r--test/files/run/reify_sort1.check (renamed from test/pending/run/reify_sort1.check)0
-rw-r--r--test/files/run/reify_sort1.scala (renamed from test/pending/run/reify_sort1.scala)0
-rw-r--r--test/files/run/reify_this.check5
-rw-r--r--test/files/run/reify_this.scala31
-rw-r--r--test/files/run/t5256a.check2
-rw-r--r--test/files/run/t5256a.scala9
-rw-r--r--test/files/run/t5256b.check2
-rw-r--r--test/files/run/t5256b.scala8
-rw-r--r--test/files/run/t5256d.check20
-rw-r--r--test/files/run/t5256d.scala10
-rw-r--r--test/files/run/t5256e.check2
-rw-r--r--test/files/run/t5256e.scala9
-rw-r--r--test/files/run/t5256f.check4
-rw-r--r--test/files/run/t5256f.scala19
-rw-r--r--test/files/run/t5258a.check1
-rw-r--r--test/files/run/t5258a.scala14
-rw-r--r--test/files/run/t5269.check (renamed from test/pending/run/t5269.check)0
-rw-r--r--test/files/run/t5269.scala (renamed from test/pending/run/t5269.scala)0
-rw-r--r--test/files/run/t5274_1.check (renamed from test/pending/run/t5274_1.check)0
-rw-r--r--test/files/run/t5274_1.scala (renamed from test/pending/run/t5274_1.scala)0
-rw-r--r--test/files/run/t5274_2.check (renamed from test/pending/run/t5274_2.check)0
-rw-r--r--test/files/run/t5274_2.scala (renamed from test/pending/run/t5274_2.scala)0
-rw-r--r--test/files/run/t5275.check (renamed from test/pending/run/t5275.check)0
-rw-r--r--test/files/run/t5275.scala (renamed from test/pending/run/t5275.scala)0
-rw-r--r--test/files/run/t5277_1.check (renamed from test/pending/run/t5277_1.check)0
-rw-r--r--test/files/run/t5277_1.scala (renamed from test/pending/run/t5277_1.scala)0
-rw-r--r--test/files/run/t5277_2.check2
-rw-r--r--test/files/run/t5277_2.scala (renamed from test/pending/run/t5277_2.scala)0
-rw-r--r--test/files/run/t5279.check (renamed from test/pending/run/t5279.check)0
-rw-r--r--test/files/run/t5279.scala (renamed from test/pending/run/t5279.scala)0
-rw-r--r--test/files/run/t5335.check (renamed from test/pending/run/t5277_2.check)1
-rw-r--r--test/files/run/t5335.scala14
-rw-r--r--test/files/run/t5415.check0
-rw-r--r--test/files/run/t5415.scala14
-rw-r--r--test/files/run/t5423.check1
-rw-r--r--test/files/run/t5423.scala12
-rw-r--r--test/files/run/virtpatmat_staging.check1
-rw-r--r--test/files/run/virtpatmat_staging.flags1
-rw-r--r--test/files/run/virtpatmat_staging.scala52
-rw-r--r--test/files/run/virtpatmat_switch.check7
-rw-r--r--test/files/run/virtpatmat_switch.flags1
-rw-r--r--test/files/run/virtpatmat_switch.scala32
-rw-r--r--test/pending/run/reify_closure6.check3
-rw-r--r--test/pending/run/reify_closure8b.check1
-rw-r--r--test/pending/run/reify_closure8b.scala17
-rw-r--r--test/pending/run/reify_closure9a.check1
-rw-r--r--test/pending/run/reify_closure9a.scala20
-rw-r--r--test/pending/run/reify_closure9b.check1
-rw-r--r--test/pending/run/reify_closure9b.scala20
-rw-r--r--test/pending/run/reify_closures11.check1
-rw-r--r--test/pending/run/reify_closures11.scala18
-rw-r--r--test/pending/run/t5256c.check0
-rw-r--r--test/pending/run/t5256c.scala10
-rw-r--r--test/pending/run/t5256g.check0
-rw-r--r--test/pending/run/t5256g.scala11
-rw-r--r--test/pending/run/t5256h.check8
-rw-r--r--test/pending/run/t5256h.scala8
-rw-r--r--test/pending/run/t5258b.check1
-rw-r--r--test/pending/run/t5258b.scala15
-rw-r--r--test/pending/run/t5258c.check1
-rw-r--r--test/pending/run/t5258c.scala15
-rw-r--r--test/pending/run/t5427a.check1
-rw-r--r--test/pending/run/t5427a.scala10
-rw-r--r--test/pending/run/t5427b.check1
-rw-r--r--test/pending/run/t5427b.scala11
-rw-r--r--test/pending/run/t5427c.check1
-rw-r--r--test/pending/run/t5427c.scala13
-rw-r--r--test/pending/run/t5427d.check1
-rw-r--r--test/pending/run/t5427d.scala11
119 files changed, 684 insertions, 24 deletions
diff --git a/test/files/buildmanager/t2562/t2562.check b/test/files/buildmanager/t2562/t2562.check
index 390bbb9986..74575f28ea 100644
--- a/test/files/buildmanager/t2562/t2562.check
+++ b/test/files/buildmanager/t2562/t2562.check
@@ -3,10 +3,10 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(object A -> List(Changed(Definition(A.x3))[method x3 changed from ()Int to ()String flags: <method>]))
-invalidate B.scala because it references changed definition [Changed(Definition(A.x3))[method x3 changed from ()Int to ()String flags: <method>]]
+Changes: Map(object A -> List(Changed(Definition(A.x3))[method x3 changed from ()Int to ()String flags: <method> <triedcooking>]))
+invalidate B.scala because it references changed definition [Changed(Definition(A.x3))[method x3 changed from ()Int to ()String flags: <method> <triedcooking>]]
compiling Set(B.scala)
-Changes: Map(object B -> List(Changed(Definition(B.x2))[method x2 changed from ()Int to ()String flags: <method>]))
-invalidate A.scala because it references changed definition [Changed(Definition(B.x2))[method x2 changed from ()Int to ()String flags: <method>]]
+Changes: Map(object B -> List(Changed(Definition(B.x2))[method x2 changed from ()Int to ()String flags: <method> <triedcooking>]))
+invalidate A.scala because it references changed definition [Changed(Definition(B.x2))[method x2 changed from ()Int to ()String flags: <method> <triedcooking>]]
compiling Set(A.scala, B.scala)
-Changes: Map(object A -> List(Changed(Definition(A.x0))[method x0 changed from ()Int to ()String flags: <method>], Changed(Definition(A.x1))[method x1 changed from ()Int to ()String flags: <method>], Changed(Definition(A.x2))[method x2 changed from ()Int to ()String flags: <method>]), object B -> List(Changed(Definition(B.x0))[method x0 changed from ()Int to ()String flags: <method>], Changed(Definition(B.x1))[method x1 changed from ()Int to ()String flags: <method>]))
+Changes: Map(object A -> List(Changed(Definition(A.x0))[method x0 changed from ()Int to ()String flags: <method>], Changed(Definition(A.x1))[method x1 changed from ()Int to ()String flags: <method> <triedcooking>], Changed(Definition(A.x2))[method x2 changed from ()Int to ()String flags: <method> <triedcooking>]), object B -> List(Changed(Definition(B.x0))[method x0 changed from ()Int to ()String flags: <method>], Changed(Definition(B.x1))[method x1 changed from ()Int to ()String flags: <method>]))
diff --git a/test/files/buildmanager/t2649/t2649.check b/test/files/buildmanager/t2649/t2649.check
index 390f284fd3..d0f41f32ec 100644
--- a/test/files/buildmanager/t2649/t2649.check
+++ b/test/files/buildmanager/t2649/t2649.check
@@ -3,7 +3,7 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(object A -> List(Changed(Definition(A.x))[method x changed from (zz: Int, yy: Int)Int to (yy: Int, zz: Int)Int flags: <method>]))
-invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from (zz: Int, yy: Int)Int to (yy: Int, zz: Int)Int flags: <method>]]
+Changes: Map(object A -> List(Changed(Definition(A.x))[method x changed from (zz: Int, yy: Int)Int to (yy: Int, zz: Int)Int flags: <method> <triedcooking>]))
+invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from (zz: Int, yy: Int)Int to (yy: Int, zz: Int)Int flags: <method> <triedcooking>]]
compiling Set(B.scala)
Changes: Map(object B -> List())
diff --git a/test/files/buildmanager/t2651_4/t2651_4.check b/test/files/buildmanager/t2651_4/t2651_4.check
index c4ce382b5f..b182f31c09 100644
--- a/test/files/buildmanager/t2651_4/t2651_4.check
+++ b/test/files/buildmanager/t2651_4/t2651_4.check
@@ -3,8 +3,8 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(trait A -> List(Changed(Definition(A.x))[method x changed from ()T to ()T flags: <deferred> <method>], Changed(Definition(A.y))[method y changed from (a: T)Unit to (a: T)Unit flags: <deferred> <method>], Changed(Definition(A.z))[method z changed from [B <: T]()Unit to [B <: T]()Unit flags: <deferred> <method>]))
-invalidate B.scala because inherited method changed [Changed(Definition(A.x))[method x changed from ()T to ()T flags: <deferred> <method>]]
+Changes: Map(trait A -> List(Changed(Definition(A.x))[method x changed from ()T to ()T flags: <deferred> <method> <triedcooking>], Changed(Definition(A.y))[method y changed from (a: T)Unit to (a: T)Unit flags: <deferred> <method>], Changed(Definition(A.z))[method z changed from [B <: T]()Unit to [B <: T]()Unit flags: <deferred> <method>]))
+invalidate B.scala because inherited method changed [Changed(Definition(A.x))[method x changed from ()T to ()T flags: <deferred> <method> <triedcooking>]]
compiling Set(B.scala)
B.scala:2: error: type mismatch;
found : Int(3)
diff --git a/test/files/buildmanager/t2652/t2652.check b/test/files/buildmanager/t2652/t2652.check
index f517f9e95a..071281c6ff 100644
--- a/test/files/buildmanager/t2652/t2652.check
+++ b/test/files/buildmanager/t2652/t2652.check
@@ -3,7 +3,7 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(class A -> List(Added(Definition(A.x$mBc$sp)), Added(Definition(A.x$mCc$sp)), Added(Definition(A.x$mDc$sp)), Added(Definition(A.x$mFc$sp)), Added(Definition(A.x$mIc$sp)), Added(Definition(A.x$mJc$sp)), Added(Definition(A.x$mSc$sp)), Added(Definition(A.x$mVc$sp)), Added(Definition(A.x$mZc$sp)), Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: <method>]))
-invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: <method>]]
+Changes: Map(class A -> List(Added(Definition(A.x$mBc$sp)), Added(Definition(A.x$mCc$sp)), Added(Definition(A.x$mDc$sp)), Added(Definition(A.x$mFc$sp)), Added(Definition(A.x$mIc$sp)), Added(Definition(A.x$mJc$sp)), Added(Definition(A.x$mSc$sp)), Added(Definition(A.x$mVc$sp)), Added(Definition(A.x$mZc$sp)), Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: <method> <triedcooking>]))
+invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from [T](t: T)T to [T](t: T)T flags: <method> <triedcooking>]]
compiling Set(B.scala)
Changes: Map(object B -> List())
diff --git a/test/files/buildmanager/t2653/t2653.check b/test/files/buildmanager/t2653/t2653.check
index 6a4fc0e982..36781522af 100644
--- a/test/files/buildmanager/t2653/t2653.check
+++ b/test/files/buildmanager/t2653/t2653.check
@@ -3,7 +3,7 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(class A -> List(Changed(Class(A))[ tparams: List((type T,type T))], Changed(Definition(A.<init>))[constructor A changed from ()A[T] to ()A[T] flags: <method>]))
+Changes: Map(class A -> List(Changed(Class(A))[ tparams: List((type T,type T))], Changed(Definition(A.<init>))[constructor A changed from ()A[T] to ()A[T] flags: <method> <triedcooking>]))
invalidate B.scala because it references changed class [Changed(Class(A))[ tparams: List((type T,type T))]]
compiling Set(B.scala)
B.scala:2: error: type mismatch;
diff --git a/test/files/buildmanager/t2655/t2655.check b/test/files/buildmanager/t2655/t2655.check
index c473e9fd6e..41ce65a2f5 100644
--- a/test/files/buildmanager/t2655/t2655.check
+++ b/test/files/buildmanager/t2655/t2655.check
@@ -3,8 +3,8 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(object A -> List(Changed(Definition(A.x))[method x changed from (i: Function0)Unit to (i: Function0)Unit flags: <method>]))
-invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from (i: Function0)Unit to (i: Function0)Unit flags: <method>]]
+Changes: Map(object A -> List(Changed(Definition(A.x))[method x changed from (i: Function0)Unit to (i: Function0)Unit flags: <method> <triedcooking>]))
+invalidate B.scala because it references changed definition [Changed(Definition(A.x))[method x changed from (i: Function0)Unit to (i: Function0)Unit flags: <method> <triedcooking>]]
compiling Set(B.scala)
B.scala:2: error: type mismatch;
found : String("3")
diff --git a/test/files/buildmanager/t2657/t2657.check b/test/files/buildmanager/t2657/t2657.check
index 3fd0e0666d..74ba87a21d 100644
--- a/test/files/buildmanager/t2657/t2657.check
+++ b/test/files/buildmanager/t2657/t2657.check
@@ -3,8 +3,8 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(class A -> List(Changed(Definition(A.y))[method y changed from (i: Int)String to (i: Int)String flags: implicit <method>]))
-invalidate B.scala because inherited method changed [Changed(Definition(A.y))[method y changed from (i: Int)String to (i: Int)String flags: implicit <method>]]
+Changes: Map(class A -> List(Changed(Definition(A.y))[method y changed from (i: Int)String to (i: Int)String flags: implicit <method> <triedcooking>]))
+invalidate B.scala because inherited method changed [Changed(Definition(A.y))[method y changed from (i: Int)String to (i: Int)String flags: implicit <method> <triedcooking>]]
compiling Set(B.scala)
B.scala:2: error: type mismatch;
found : Int(3)
diff --git a/test/files/buildmanager/t2789/t2789.check b/test/files/buildmanager/t2789/t2789.check
index 78c5119355..a7c767cc45 100644
--- a/test/files/buildmanager/t2789/t2789.check
+++ b/test/files/buildmanager/t2789/t2789.check
@@ -3,8 +3,8 @@ compiling Set(A.scala, B.scala)
Changes: Map()
builder > A.scala
compiling Set(A.scala)
-Changes: Map(class A -> List(Changed(Definition(A.e))[method e changed from ()E to ()E flags: implicit <method>]), class E -> List())
-invalidate B.scala because inherited method changed [Changed(Definition(A.e))[method e changed from ()E to ()E flags: implicit <method>]]
+Changes: Map(class A -> List(Changed(Definition(A.e))[method e changed from ()E to ()E flags: implicit <method> <triedcooking>]), class E -> List())
+invalidate B.scala because inherited method changed [Changed(Definition(A.e))[method e changed from ()E to ()E flags: implicit <method> <triedcooking>]]
compiling Set(B.scala)
B.scala:2: error: could not find implicit value for parameter y: E
val y = x(3)
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check
index 0881205bb4..d785179a56 100644
--- a/test/files/neg/checksensible.check
+++ b/test/files/neg/checksensible.check
@@ -28,6 +28,9 @@ checksensible.scala:27: error: comparing values of types Int and Unit using `=='
checksensible.scala:29: error: comparing values of types Int and String using `==' will always yield false
1 == "abc"
^
+checksensible.scala:33: error: comparing values of types Some[Int] and Int using `==' will always yield false
+ Some(1) == 1 // as above
+ ^
checksensible.scala:38: error: comparing a fresh object using `==' will always yield false
new AnyRef == 1
^
@@ -94,4 +97,4 @@ checksensible.scala:84: error: comparing values of types EqEqRefTest.this.C3 and
checksensible.scala:95: error: comparing values of types Unit and Int using `!=' will always yield true
while ((c = in.read) != -1)
^
-32 errors found
+33 errors found
diff --git a/test/files/neg/t5352.check b/test/files/neg/t5352.check
new file mode 100644
index 0000000000..d24b0e8ee1
--- /dev/null
+++ b/test/files/neg/t5352.check
@@ -0,0 +1,13 @@
+t5352.scala:11: error: type mismatch;
+ found : boop.Bar
+ required: boop.BarF
+ (which expands to) AnyRef{def f(): Int}
+ x = xs.head
+ ^
+t5352.scala:14: error: method f in class Bar1 cannot be accessed in boop.Bar1
+ Access to protected method f not permitted because
+ enclosing object boop is not a subclass of
+ class Bar1 in object boop where target is defined
+ (new Bar1).f
+ ^
+two errors found
diff --git a/test/files/neg/t5352.flags b/test/files/neg/t5352.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t5352.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t5352.scala b/test/files/neg/t5352.scala
new file mode 100644
index 0000000000..6ee41f5680
--- /dev/null
+++ b/test/files/neg/t5352.scala
@@ -0,0 +1,15 @@
+object boop {
+ abstract class Bar { protected def f(): Any }
+ class Bar1 extends Bar { protected def f(): Int = 5 }
+ class Bar2 extends Bar { protected def f(): Int = 5 }
+
+ val xs = List(new Bar1, new Bar2)
+
+ type BarF = { def f(): Int }
+
+ var x: BarF = _
+ x = xs.head
+ x.f
+
+ (new Bar1).f
+}
diff --git a/test/files/neg/t5426.check b/test/files/neg/t5426.check
new file mode 100644
index 0000000000..d9e192d3f0
--- /dev/null
+++ b/test/files/neg/t5426.check
@@ -0,0 +1,13 @@
+t5426.scala:2: error: comparing values of types Some[Int] and Int using `==' will always yield false
+ def f1 = Some(5) == 5
+ ^
+t5426.scala:3: error: comparing values of types Int and Some[Int] using `==' will always yield false
+ def f2 = 5 == Some(5)
+ ^
+t5426.scala:8: error: comparing values of types Int and Some[Int] using `==' will always yield false
+ (x1 == x2)
+ ^
+t5426.scala:9: error: comparing values of types Some[Int] and Int using `==' will always yield false
+ (x2 == x1)
+ ^
+four errors found
diff --git a/test/files/neg/t5426.flags b/test/files/neg/t5426.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t5426.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t5426.scala b/test/files/neg/t5426.scala
new file mode 100644
index 0000000000..f2fb5cc12c
--- /dev/null
+++ b/test/files/neg/t5426.scala
@@ -0,0 +1,10 @@
+class A {
+ def f1 = Some(5) == 5
+ def f2 = 5 == Some(5)
+
+ val x1 = 5
+ val x2 = Some(5)
+
+ (x1 == x2)
+ (x2 == x1)
+}
diff --git a/test/files/neg/unicode-unterminated-quote.check b/test/files/neg/unicode-unterminated-quote.check
new file mode 100644
index 0000000000..fc5caa6d7e
--- /dev/null
+++ b/test/files/neg/unicode-unterminated-quote.check
@@ -0,0 +1,4 @@
+unicode-unterminated-quote.scala:2: error: unclosed string literal
+ val x = /u0022
+ ^
+one error found
diff --git a/test/files/neg/unicode-unterminated-quote.scala b/test/files/neg/unicode-unterminated-quote.scala
new file mode 100644
index 0000000000..bb6eab667f
--- /dev/null
+++ b/test/files/neg/unicode-unterminated-quote.scala
@@ -0,0 +1,2 @@
+class A {
+ val x = \u0022 \ No newline at end of file
diff --git a/test/files/run/buffer-slice.check b/test/files/run/buffer-slice.check
new file mode 100644
index 0000000000..5287aa9d7b
--- /dev/null
+++ b/test/files/run/buffer-slice.check
@@ -0,0 +1 @@
+ArrayBuffer()
diff --git a/test/files/run/buffer-slice.scala b/test/files/run/buffer-slice.scala
new file mode 100644
index 0000000000..ddd82e0751
--- /dev/null
+++ b/test/files/run/buffer-slice.scala
@@ -0,0 +1,5 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ println(scala.collection.mutable.ArrayBuffer().slice(102450392, -2045033354))
+ }
+}
diff --git a/test/files/run/code.check b/test/files/run/code.check
index b946554fda..9b0351bbf9 100644
--- a/test/files/run/code.check
+++ b/test/files/run/code.check
@@ -1,29 +1,36 @@
testing: ((x: Int) => x.$plus(ys.length))
+type is: Int => Int
result = ((x: Int) => x.+{(x: <?>)Int}(ys.length{Int}){Int}){Int => Int}
evaluated = <function1>
testing: (() => {
val e: Element = new Element("someName");
e
})
+type is: () => Element
result = (() => {
val e: Element = new Element{Element}{(name: <?>)Element}("someName"{String("someName")}){Element};
e{Element}
}{Element}){() => Element}
evaluated = Element(someName)
testing: (() => truc.elem = 6)
+type is: () => Unit
result = (() => truc.elem{Int} = 6{Int(6)}{Unit}){() => Unit}
evaluated = null
testing: (() => truc.elem = truc.elem.$plus(6))
+type is: () => Unit
result = (() => truc.elem{Int} = truc.elem.+{(x: <?>)Int}(6{Int(6)}){Int}{Unit}){() => Unit}
evaluated = null
testing: (() => new baz.BazElement("someName"))
+type is: () => baz.BazElement
result = (() => new baz.BazElement{baz.BazElement}{(name: <?>)baz.BazElement}("someName"{String("someName")}){baz.BazElement}){() => baz.BazElement}
evaluated = BazElement(someName)
testing: ((x: Int) => x.$plus(ys.length))
+type is: Int => Int
result = ((x: Int) => x.+{(x: <?>)Int}(ys.length{Int}){Int}){Int => Int}
evaluated = <function1>
static: 2
testing: (() => x.$plus(1))
+type is: () => Int
result = (() => x.+{(x: <?>)Int}(1{Int(1)}){Int}){() => Int}
evaluated = 2
1+1 = 2
diff --git a/test/pending/run/reify_closure1.check b/test/files/run/reify_closure1.check
index b2f7f08c17..b2f7f08c17 100644
--- a/test/pending/run/reify_closure1.check
+++ b/test/files/run/reify_closure1.check
diff --git a/test/pending/run/reify_closure1.scala b/test/files/run/reify_closure1.scala
index 825a38dc1d..825a38dc1d 100644
--- a/test/pending/run/reify_closure1.scala
+++ b/test/files/run/reify_closure1.scala
diff --git a/test/pending/run/reify_closure2a.check b/test/files/run/reify_closure2a.check
index c1f3abd7e6..c1f3abd7e6 100644
--- a/test/pending/run/reify_closure2a.check
+++ b/test/files/run/reify_closure2a.check
diff --git a/test/pending/run/reify_closure2a.scala b/test/files/run/reify_closure2a.scala
index b88bec005d..b88bec005d 100644
--- a/test/pending/run/reify_closure2a.scala
+++ b/test/files/run/reify_closure2a.scala
diff --git a/test/pending/run/reify_closure3a.check b/test/files/run/reify_closure3a.check
index c1f3abd7e6..c1f3abd7e6 100644
--- a/test/pending/run/reify_closure3a.check
+++ b/test/files/run/reify_closure3a.check
diff --git a/test/pending/run/reify_closure3a.scala b/test/files/run/reify_closure3a.scala
index 6414fa58a3..6414fa58a3 100644
--- a/test/pending/run/reify_closure3a.scala
+++ b/test/files/run/reify_closure3a.scala
diff --git a/test/pending/run/reify_closure4a.check b/test/files/run/reify_closure4a.check
index c1f3abd7e6..c1f3abd7e6 100644
--- a/test/pending/run/reify_closure4a.check
+++ b/test/files/run/reify_closure4a.check
diff --git a/test/pending/run/reify_closure4a.scala b/test/files/run/reify_closure4a.scala
index 99e9d82706..99e9d82706 100644
--- a/test/pending/run/reify_closure4a.scala
+++ b/test/files/run/reify_closure4a.scala
diff --git a/test/pending/run/reify_closure5a.check b/test/files/run/reify_closure5a.check
index df9e19c591..df9e19c591 100644
--- a/test/pending/run/reify_closure5a.check
+++ b/test/files/run/reify_closure5a.check
diff --git a/test/pending/run/reify_closure5a.scala b/test/files/run/reify_closure5a.scala
index 0ac53d5479..0ac53d5479 100644
--- a/test/pending/run/reify_closure5a.scala
+++ b/test/files/run/reify_closure5a.scala
diff --git a/test/files/run/reify_closure6.check b/test/files/run/reify_closure6.check
new file mode 100644
index 0000000000..b9de4c6baf
--- /dev/null
+++ b/test/files/run/reify_closure6.check
@@ -0,0 +1,7 @@
+q = 1
+y = 1
+first invocation = 15
+q = 2
+y = 1
+second invocation = 17
+q after second invocation = 2 \ No newline at end of file
diff --git a/test/pending/run/reify_closure6.scala b/test/files/run/reify_closure6.scala
index 909071aa44..54f1791bf2 100644
--- a/test/pending/run/reify_closure6.scala
+++ b/test/files/run/reify_closure6.scala
@@ -10,6 +10,8 @@ object Test extends App {
val fun: reflect.Code[Int => Int] = x => {
y += 1
q += 1
+ println("q = " + q)
+ println("y = " + y)
x + ys.length * z + q + y
}
@@ -23,4 +25,4 @@ object Test extends App {
println("first invocation = " + foo(List(1, 2, 3))(10))
println("second invocation = " + foo(List(1, 2, 3, 4))(10))
println("q after second invocation = " + q)
-}
+} \ No newline at end of file
diff --git a/test/files/run/reify_closure7.check b/test/files/run/reify_closure7.check
new file mode 100644
index 0000000000..bf58b52bce
--- /dev/null
+++ b/test/files/run/reify_closure7.check
@@ -0,0 +1,6 @@
+q = 1
+y = 1
+first invocation = 15
+q = 2
+y = 2
+second invocation = 17
diff --git a/test/files/run/reify_closure7.scala b/test/files/run/reify_closure7.scala
new file mode 100644
index 0000000000..8933df23fa
--- /dev/null
+++ b/test/files/run/reify_closure7.scala
@@ -0,0 +1,32 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ var q = 0
+ var clo: Int => Int = null
+ def foo[T](ys: List[T]): Int => Int = {
+ val z = 1
+ var y = 0
+ val fun: reflect.Code[Int => Int] = x => {
+ y += 1
+ q += 1
+ println("q = " + q)
+ println("y = " + y)
+ x + ys.length * z + q + y
+ }
+
+ if (clo == null) {
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(fun.tree)
+ val dyn = toolbox.runExpr(ttree)
+ clo = dyn.asInstanceOf[Int => Int]
+ }
+
+ clo
+ }
+
+ println("first invocation = " + foo(List(1, 2, 3))(10))
+ println("second invocation = " + foo(List(1, 2, 3, 4))(10))
+}
diff --git a/test/files/run/reify_closure8a.check b/test/files/run/reify_closure8a.check
new file mode 100644
index 0000000000..9a037142aa
--- /dev/null
+++ b/test/files/run/reify_closure8a.check
@@ -0,0 +1 @@
+10 \ No newline at end of file
diff --git a/test/files/run/reify_closure8a.scala b/test/files/run/reify_closure8a.scala
new file mode 100644
index 0000000000..5e54bfc8c7
--- /dev/null
+++ b/test/files/run/reify_closure8a.scala
@@ -0,0 +1,17 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ class Foo(val y: Int) {
+ def fun = lift{y}
+ }
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(new Foo(10).fun.tree)
+ val dyn = toolbox.runExpr(ttree)
+ val foo = dyn.asInstanceOf[Int]
+ println(foo)
+}
diff --git a/test/files/run/reify_closures10.check b/test/files/run/reify_closures10.check
new file mode 100644
index 0000000000..fd3c81a4d7
--- /dev/null
+++ b/test/files/run/reify_closures10.check
@@ -0,0 +1,2 @@
+5
+5
diff --git a/test/files/run/reify_closures10.scala b/test/files/run/reify_closures10.scala
new file mode 100644
index 0000000000..d0f895ae4d
--- /dev/null
+++ b/test/files/run/reify_closures10.scala
@@ -0,0 +1,15 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val x = 2
+ val y = 3
+ val code = lift{println(x + y); x + y}
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ println(toolbox.runExpr(ttree))
+}
diff --git a/test/pending/run/reify_complex.check b/test/files/run/reify_complex.check
index 7df35e33a0..7df35e33a0 100644
--- a/test/pending/run/reify_complex.check
+++ b/test/files/run/reify_complex.check
diff --git a/test/pending/run/reify_complex.scala b/test/files/run/reify_complex.scala
index aae4d558cf..aae4d558cf 100644
--- a/test/pending/run/reify_complex.scala
+++ b/test/files/run/reify_complex.scala
diff --git a/test/pending/run/reify_extendbuiltins.check b/test/files/run/reify_extendbuiltins.check
index a48033a30d..a48033a30d 100644
--- a/test/pending/run/reify_extendbuiltins.check
+++ b/test/files/run/reify_extendbuiltins.check
diff --git a/test/pending/run/reify_extendbuiltins.scala b/test/files/run/reify_extendbuiltins.scala
index 57acd699ff..57acd699ff 100644
--- a/test/pending/run/reify_extendbuiltins.scala
+++ b/test/files/run/reify_extendbuiltins.scala
diff --git a/test/files/run/reify_generic2.check b/test/files/run/reify_generic2.check
new file mode 100644
index 0000000000..b8626c4cff
--- /dev/null
+++ b/test/files/run/reify_generic2.check
@@ -0,0 +1 @@
+4
diff --git a/test/files/run/reify_generic2.scala b/test/files/run/reify_generic2.scala
new file mode 100644
index 0000000000..d03fe7602b
--- /dev/null
+++ b/test/files/run/reify_generic2.scala
@@ -0,0 +1,16 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val code = scala.reflect.Code.lift{
+ class C
+ val product = List(new C, new C).length * List[C](new C, new C).length
+ println(product)
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+}
diff --git a/test/files/run/reify_getter.check b/test/files/run/reify_getter.check
new file mode 100644
index 0000000000..5ef4ff4d04
--- /dev/null
+++ b/test/files/run/reify_getter.check
@@ -0,0 +1 @@
+evaluated = 2
diff --git a/test/files/run/reify_getter.scala b/test/files/run/reify_getter.scala
new file mode 100644
index 0000000000..83eaded506
--- /dev/null
+++ b/test/files/run/reify_getter.scala
@@ -0,0 +1,19 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val code = scala.reflect.Code.lift{
+ class C {
+ val x = 2
+ }
+
+ new C().x
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ val evaluated = toolbox.runExpr(ttree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/pending/run/reify_implicits.check b/test/files/run/reify_implicits.check
index e3aeb20f6b..e3aeb20f6b 100644
--- a/test/pending/run/reify_implicits.check
+++ b/test/files/run/reify_implicits.check
diff --git a/test/pending/run/reify_implicits.scala b/test/files/run/reify_implicits.scala
index a15cef9c97..a15cef9c97 100644
--- a/test/pending/run/reify_implicits.scala
+++ b/test/files/run/reify_implicits.scala
diff --git a/test/pending/run/reify_sort.check b/test/files/run/reify_sort.check
index 375536cc29..375536cc29 100644
--- a/test/pending/run/reify_sort.check
+++ b/test/files/run/reify_sort.check
diff --git a/test/pending/run/reify_sort.scala b/test/files/run/reify_sort.scala
index 42991fe5d2..42991fe5d2 100644
--- a/test/pending/run/reify_sort.scala
+++ b/test/files/run/reify_sort.scala
diff --git a/test/pending/run/reify_sort1.check b/test/files/run/reify_sort1.check
index 0d30805141..0d30805141 100644
--- a/test/pending/run/reify_sort1.check
+++ b/test/files/run/reify_sort1.check
diff --git a/test/pending/run/reify_sort1.scala b/test/files/run/reify_sort1.scala
index 42f4c824a5..42f4c824a5 100644
--- a/test/pending/run/reify_sort1.scala
+++ b/test/files/run/reify_sort1.scala
diff --git a/test/files/run/reify_this.check b/test/files/run/reify_this.check
new file mode 100644
index 0000000000..af3d0652a9
--- /dev/null
+++ b/test/files/run/reify_this.check
@@ -0,0 +1,5 @@
+foo
+false
+2
+bar
+2 \ No newline at end of file
diff --git a/test/files/run/reify_this.scala b/test/files/run/reify_this.scala
new file mode 100644
index 0000000000..38ef72b6eb
--- /dev/null
+++ b/test/files/run/reify_this.scala
@@ -0,0 +1,31 @@
+import scala.reflect._
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+trait Eval {
+ def eval(code: Code[_]): Any = eval(code.tree)
+
+ def eval(tree: Tree): Any = {
+ val settings = new Settings
+ val reporter = new ConsoleReporter(settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(tree)
+ toolbox.runExpr(ttree)
+ }
+}
+
+object Test extends App with Eval {
+ // select a value from package
+ eval(lift{println("foo")})
+ eval(lift{println((new Object).toString == (new Object).toString)})
+
+ // select a type from package
+ eval(lift{val x: Any = 2; println(x)})
+ eval(lift{val x: Object = "bar"; println(x)})
+
+ // select a value from module
+ val x = 2
+ eval(lift{println(x)})
+}
diff --git a/test/files/run/t5256a.check b/test/files/run/t5256a.check
new file mode 100644
index 0000000000..304f4ddd79
--- /dev/null
+++ b/test/files/run/t5256a.check
@@ -0,0 +1,2 @@
+A
+true
diff --git a/test/files/run/t5256a.scala b/test/files/run/t5256a.scala
new file mode 100644
index 0000000000..05a935c770
--- /dev/null
+++ b/test/files/run/t5256a.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+class A
+
+object Test extends App {
+ val c = classToType(classOf[A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[A]))
+}
diff --git a/test/files/run/t5256b.check b/test/files/run/t5256b.check
new file mode 100644
index 0000000000..64f4c01166
--- /dev/null
+++ b/test/files/run/t5256b.check
@@ -0,0 +1,2 @@
+Test.A
+true \ No newline at end of file
diff --git a/test/files/run/t5256b.scala b/test/files/run/t5256b.scala
new file mode 100644
index 0000000000..5575211641
--- /dev/null
+++ b/test/files/run/t5256b.scala
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class A
+ val c = classToType(classOf[A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[A]))
+}
diff --git a/test/files/run/t5256d.check b/test/files/run/t5256d.check
new file mode 100644
index 0000000000..7924c15c5c
--- /dev/null
+++ b/test/files/run/t5256d.check
@@ -0,0 +1,20 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> class A
+defined class A
+
+scala> val c = classToType(classOf[A])
+c: reflect.mirror.Type = A
+
+scala> println(c.typeSymbol == classToSymbol(classOf[A]))
+true
+
+scala>
+
+scala>
diff --git a/test/files/run/t5256d.scala b/test/files/run/t5256d.scala
new file mode 100644
index 0000000000..86404a9b63
--- /dev/null
+++ b/test/files/run/t5256d.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+import scala.reflect.mirror._
+class A
+val c = classToType(classOf[A])
+println(c.typeSymbol == classToSymbol(classOf[A]))
+ """
+}
diff --git a/test/files/run/t5256e.check b/test/files/run/t5256e.check
new file mode 100644
index 0000000000..e50f917e14
--- /dev/null
+++ b/test/files/run/t5256e.check
@@ -0,0 +1,2 @@
+C.this.A
+true \ No newline at end of file
diff --git a/test/files/run/t5256e.scala b/test/files/run/t5256e.scala
new file mode 100644
index 0000000000..9ed422ca44
--- /dev/null
+++ b/test/files/run/t5256e.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+class C { class A }
+
+object Test extends App {
+ val c = classToType(classOf[C#A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[C#A]))
+}
diff --git a/test/files/run/t5256f.check b/test/files/run/t5256f.check
new file mode 100644
index 0000000000..ad2f375d9a
--- /dev/null
+++ b/test/files/run/t5256f.check
@@ -0,0 +1,4 @@
+Test.A1
+true
+Test.this.A2
+true
diff --git a/test/files/run/t5256f.scala b/test/files/run/t5256f.scala
new file mode 100644
index 0000000000..45c80cbd63
--- /dev/null
+++ b/test/files/run/t5256f.scala
@@ -0,0 +1,19 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class A1
+
+ val c1 = classToType(classOf[A1])
+ println(c1)
+ println(c1.typeSymbol == classToSymbol(classOf[A1]))
+
+ new Test
+}
+
+class Test {
+ class A2
+
+ val c2 = classToType(classOf[A2])
+ println(c2)
+ println(c2.typeSymbol == classToSymbol(classOf[A2]))
+}
diff --git a/test/files/run/t5258a.check b/test/files/run/t5258a.check
new file mode 100644
index 0000000000..4e0b2da04c
--- /dev/null
+++ b/test/files/run/t5258a.check
@@ -0,0 +1 @@
+int \ No newline at end of file
diff --git a/test/files/run/t5258a.scala b/test/files/run/t5258a.scala
new file mode 100644
index 0000000000..deabb8310f
--- /dev/null
+++ b/test/files/run/t5258a.scala
@@ -0,0 +1,14 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val code = scala.reflect.Code.lift{
+ println(classOf[Int])
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+} \ No newline at end of file
diff --git a/test/pending/run/t5269.check b/test/files/run/t5269.check
index 0cfbf08886..0cfbf08886 100644
--- a/test/pending/run/t5269.check
+++ b/test/files/run/t5269.check
diff --git a/test/pending/run/t5269.scala b/test/files/run/t5269.scala
index a30509f3fe..a30509f3fe 100644
--- a/test/pending/run/t5269.scala
+++ b/test/files/run/t5269.scala
diff --git a/test/pending/run/t5274_1.check b/test/files/run/t5274_1.check
index fca8bc3d3e..fca8bc3d3e 100644
--- a/test/pending/run/t5274_1.check
+++ b/test/files/run/t5274_1.check
diff --git a/test/pending/run/t5274_1.scala b/test/files/run/t5274_1.scala
index c501172518..c501172518 100644
--- a/test/pending/run/t5274_1.scala
+++ b/test/files/run/t5274_1.scala
diff --git a/test/pending/run/t5274_2.check b/test/files/run/t5274_2.check
index 375536cc29..375536cc29 100644
--- a/test/pending/run/t5274_2.check
+++ b/test/files/run/t5274_2.check
diff --git a/test/pending/run/t5274_2.scala b/test/files/run/t5274_2.scala
index 42991fe5d2..42991fe5d2 100644
--- a/test/pending/run/t5274_2.scala
+++ b/test/files/run/t5274_2.scala
diff --git a/test/pending/run/t5275.check b/test/files/run/t5275.check
index 0cfbf08886..0cfbf08886 100644
--- a/test/pending/run/t5275.check
+++ b/test/files/run/t5275.check
diff --git a/test/pending/run/t5275.scala b/test/files/run/t5275.scala
index d419834ded..d419834ded 100644
--- a/test/pending/run/t5275.scala
+++ b/test/files/run/t5275.scala
diff --git a/test/pending/run/t5277_1.check b/test/files/run/t5277_1.check
index a48033a30d..a48033a30d 100644
--- a/test/pending/run/t5277_1.check
+++ b/test/files/run/t5277_1.check
diff --git a/test/pending/run/t5277_1.scala b/test/files/run/t5277_1.scala
index 57acd699ff..57acd699ff 100644
--- a/test/pending/run/t5277_1.scala
+++ b/test/files/run/t5277_1.scala
diff --git a/test/files/run/t5277_2.check b/test/files/run/t5277_2.check
new file mode 100644
index 0000000000..ca017e2a40
--- /dev/null
+++ b/test/files/run/t5277_2.check
@@ -0,0 +1,2 @@
+2()
+1()
diff --git a/test/pending/run/t5277_2.scala b/test/files/run/t5277_2.scala
index 67b6b000bc..67b6b000bc 100644
--- a/test/pending/run/t5277_2.scala
+++ b/test/files/run/t5277_2.scala
diff --git a/test/pending/run/t5279.check b/test/files/run/t5279.check
index f599e28b8a..f599e28b8a 100644
--- a/test/pending/run/t5279.check
+++ b/test/files/run/t5279.check
diff --git a/test/pending/run/t5279.scala b/test/files/run/t5279.scala
index 39e7dd2c66..39e7dd2c66 100644
--- a/test/pending/run/t5279.scala
+++ b/test/files/run/t5279.scala
diff --git a/test/pending/run/t5277_2.check b/test/files/run/t5335.check
index 5f1d0ecea5..0cfbf08886 100644
--- a/test/pending/run/t5277_2.check
+++ b/test/files/run/t5335.check
@@ -1,2 +1 @@
2
-1
diff --git a/test/files/run/t5335.scala b/test/files/run/t5335.scala
new file mode 100644
index 0000000000..9a8b91f04d
--- /dev/null
+++ b/test/files/run/t5335.scala
@@ -0,0 +1,14 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val code = scala.reflect.Code.lift{
+ println(new {def x = 2}.x)
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+}
diff --git a/test/files/run/t5415.check b/test/files/run/t5415.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t5415.check
diff --git a/test/files/run/t5415.scala b/test/files/run/t5415.scala
new file mode 100644
index 0000000000..3db356da86
--- /dev/null
+++ b/test/files/run/t5415.scala
@@ -0,0 +1,14 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import scala.reflect.runtime.Mirror.ToolBox
+
+object Test extends App{
+ case class Queryable2[T]() { def filter(predicate: T => Boolean) = ??? }
+ trait CoffeesTable{ def sales : Int }
+ val q = Queryable2[CoffeesTable]()
+ val code = scala.reflect.Code.lift{q.filter(_.sales > 5)}
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+}
diff --git a/test/files/run/t5423.check b/test/files/run/t5423.check
new file mode 100644
index 0000000000..ae3d3fb82b
--- /dev/null
+++ b/test/files/run/t5423.check
@@ -0,0 +1 @@
+List(table) \ No newline at end of file
diff --git a/test/files/run/t5423.scala b/test/files/run/t5423.scala
new file mode 100644
index 0000000000..2139773ff1
--- /dev/null
+++ b/test/files/run/t5423.scala
@@ -0,0 +1,12 @@
+import java.lang.Class
+import scala.reflect.mirror._
+import scala.reflect.runtime.Mirror.ToolBox
+import scala.reflect.Code
+
+final class table extends StaticAnnotation
+@table class A
+
+object Test extends App{
+ val s = classToSymbol(classOf[A])
+ println(s.getAnnotations)
+}
diff --git a/test/files/run/virtpatmat_staging.check b/test/files/run/virtpatmat_staging.check
new file mode 100644
index 0000000000..106ae40b99
--- /dev/null
+++ b/test/files/run/virtpatmat_staging.check
@@ -0,0 +1 @@
+runOrElse(7, ?guard(false,?).flatMap(? =>one(foo)).orElse(one(bar)))
diff --git a/test/files/run/virtpatmat_staging.flags b/test/files/run/virtpatmat_staging.flags
new file mode 100644
index 0000000000..9769db9257
--- /dev/null
+++ b/test/files/run/virtpatmat_staging.flags
@@ -0,0 +1 @@
+ -Yvirtpatmat -Xexperimental
diff --git a/test/files/run/virtpatmat_staging.scala b/test/files/run/virtpatmat_staging.scala
new file mode 100644
index 0000000000..c17b45043b
--- /dev/null
+++ b/test/files/run/virtpatmat_staging.scala
@@ -0,0 +1,52 @@
+trait Intf {
+ type Rep[+T]
+ type M[+T] = Rep[Maybe[T]]
+
+ val __match: Matcher
+ abstract class Matcher {
+ // runs the matcher on the given input
+ def runOrElse[T, U](in: Rep[T])(matcher: Rep[T] => M[U]): Rep[U]
+
+ def zero: M[Nothing]
+ def one[T](x: Rep[T]): M[T]
+ def guard[T](cond: Rep[Boolean], then: => Rep[T]): M[T]
+ def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] // used for isDefinedAt
+ }
+
+ abstract class Maybe[+A] {
+ def flatMap[B](f: Rep[A] => M[B]): M[B]
+ def orElse[B >: A](alternative: => M[B]): M[B]
+ }
+
+ implicit def proxyMaybe[A](m: M[A]): Maybe[A]
+ implicit def repInt(x: Int): Rep[Int]
+ implicit def repBoolean(x: Boolean): Rep[Boolean]
+ implicit def repString(x: String): Rep[String]
+
+ def test = 7 match { case 5 => "foo" case _ => "bar" }
+}
+
+trait Impl extends Intf {
+ type Rep[+T] = String
+
+ object __match extends Matcher {
+ def runOrElse[T, U](in: Rep[T])(matcher: Rep[T] => M[U]): Rep[U] = ("runOrElse("+ in +", ?" + matcher("?") + ")")
+ def zero: M[Nothing] = "zero"
+ def one[T](x: Rep[T]): M[T] = "one("+x.toString+")"
+ def guard[T](cond: Rep[Boolean], then: => Rep[T]): M[T] = "guard("+cond+","+then+")"
+ def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] = ("isSuccess("+x+", ?" + f("?") + ")")
+ }
+
+ implicit def proxyMaybe[A](m: M[A]): Maybe[A] = new Maybe[A] {
+ def flatMap[B](f: Rep[A] => M[B]): M[B] = m + ".flatMap(? =>"+ f("?") +")"
+ def orElse[B >: A](alternative: => M[B]): M[B] = m + ".orElse("+ alternative +")"
+ }
+
+ def repInt(x: Int): Rep[Int] = x.toString
+ def repBoolean(x: Boolean): Rep[Boolean] = x.toString
+ def repString(x: String): Rep[String] = x
+}
+
+object Test extends Impl with Intf with App {
+ println(test)
+}
diff --git a/test/files/run/virtpatmat_switch.check b/test/files/run/virtpatmat_switch.check
new file mode 100644
index 0000000000..6ded95c010
--- /dev/null
+++ b/test/files/run/virtpatmat_switch.check
@@ -0,0 +1,7 @@
+zero
+one
+many
+got a
+got b
+got some letter
+scala.MatchError: 5 (of class java.lang.Integer) \ No newline at end of file
diff --git a/test/files/run/virtpatmat_switch.flags b/test/files/run/virtpatmat_switch.flags
new file mode 100644
index 0000000000..9769db9257
--- /dev/null
+++ b/test/files/run/virtpatmat_switch.flags
@@ -0,0 +1 @@
+ -Yvirtpatmat -Xexperimental
diff --git a/test/files/run/virtpatmat_switch.scala b/test/files/run/virtpatmat_switch.scala
new file mode 100644
index 0000000000..2e2c31e8e5
--- /dev/null
+++ b/test/files/run/virtpatmat_switch.scala
@@ -0,0 +1,32 @@
+object Test extends App {
+ def intSwitch(x: Int) = x match {
+ case 0 => "zero"
+ case 1 => "one"
+ case _ => "many"
+ }
+
+ println(intSwitch(0))
+ println(intSwitch(1))
+ println(intSwitch(10))
+
+ def charSwitch(x: Char) = x match {
+ case 'a' => "got a"
+ case 'b' => "got b"
+ case _ => "got some letter"
+ }
+
+ println(charSwitch('a'))
+ println(charSwitch('b'))
+ println(charSwitch('z'))
+
+ def implicitDefault(x: Int) = x match {
+ case 0 => 0
+ }
+
+ try {
+ implicitDefault(5)
+ } catch {
+ case e: MatchError => println(e)
+ }
+
+}
diff --git a/test/pending/run/reify_closure6.check b/test/pending/run/reify_closure6.check
deleted file mode 100644
index 3526d04b0e..0000000000
--- a/test/pending/run/reify_closure6.check
+++ /dev/null
@@ -1,3 +0,0 @@
-first invocation = 15
-second invocation = 18
-q after second invocation = 2
diff --git a/test/pending/run/reify_closure8b.check b/test/pending/run/reify_closure8b.check
new file mode 100644
index 0000000000..9a037142aa
--- /dev/null
+++ b/test/pending/run/reify_closure8b.check
@@ -0,0 +1 @@
+10 \ No newline at end of file
diff --git a/test/pending/run/reify_closure8b.scala b/test/pending/run/reify_closure8b.scala
new file mode 100644
index 0000000000..9e37e4e09a
--- /dev/null
+++ b/test/pending/run/reify_closure8b.scala
@@ -0,0 +1,17 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ class Foo(y: Int) {
+ def fun = lift{y}
+ }
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(new Foo(10).fun.tree)
+ val dyn = toolbox.runExpr(ttree)
+ val foo = dyn.asInstanceOf[Int]
+ println(foo)
+}
diff --git a/test/pending/run/reify_closure9a.check b/test/pending/run/reify_closure9a.check
new file mode 100644
index 0000000000..9a037142aa
--- /dev/null
+++ b/test/pending/run/reify_closure9a.check
@@ -0,0 +1 @@
+10 \ No newline at end of file
diff --git a/test/pending/run/reify_closure9a.scala b/test/pending/run/reify_closure9a.scala
new file mode 100644
index 0000000000..f3ee153d3c
--- /dev/null
+++ b/test/pending/run/reify_closure9a.scala
@@ -0,0 +1,20 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ def foo(y: Int) = {
+ class Foo(val y: Int) {
+ def fun = lift{y}
+ }
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(new Foo(y).fun.tree)
+ val dyn = toolbox.runExpr(ttree)
+ dyn.asInstanceOf[Int]
+ }
+
+ println(foo(10))
+}
diff --git a/test/pending/run/reify_closure9b.check b/test/pending/run/reify_closure9b.check
new file mode 100644
index 0000000000..9a037142aa
--- /dev/null
+++ b/test/pending/run/reify_closure9b.check
@@ -0,0 +1 @@
+10 \ No newline at end of file
diff --git a/test/pending/run/reify_closure9b.scala b/test/pending/run/reify_closure9b.scala
new file mode 100644
index 0000000000..8d349e8701
--- /dev/null
+++ b/test/pending/run/reify_closure9b.scala
@@ -0,0 +1,20 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ def foo(y: Int) = {
+ class Foo(y: Int) {
+ def fun = lift{y}
+ }
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(new Foo(y).fun.tree)
+ val dyn = toolbox.runExpr(ttree)
+ dyn.asInstanceOf[Int]
+ }
+
+ println(foo(10))
+}
diff --git a/test/pending/run/reify_closures11.check b/test/pending/run/reify_closures11.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/pending/run/reify_closures11.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/pending/run/reify_closures11.scala b/test/pending/run/reify_closures11.scala
new file mode 100644
index 0000000000..42053bd029
--- /dev/null
+++ b/test/pending/run/reify_closures11.scala
@@ -0,0 +1,18 @@
+import scala.reflect.Code._
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ def fun() = {
+ def z() = 2
+ lift{z}
+ }
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(fun().tree)
+ val dyn = toolbox.runExpr(ttree)
+ val foo = dyn.asInstanceOf[Int]
+ println(foo)
+}
diff --git a/test/pending/run/t5256c.check b/test/pending/run/t5256c.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/pending/run/t5256c.check
diff --git a/test/pending/run/t5256c.scala b/test/pending/run/t5256c.scala
new file mode 100644
index 0000000000..8ebb51a009
--- /dev/null
+++ b/test/pending/run/t5256c.scala
@@ -0,0 +1,10 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class A
+ val c = classToType(classOf[A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[A]))
+ }
+}
diff --git a/test/pending/run/t5256g.check b/test/pending/run/t5256g.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/pending/run/t5256g.check
diff --git a/test/pending/run/t5256g.scala b/test/pending/run/t5256g.scala
new file mode 100644
index 0000000000..6158a9281d
--- /dev/null
+++ b/test/pending/run/t5256g.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+class A
+trait B
+
+object Test extends App {
+ val mutant = new A with B
+ val c = classToType(mutant.getClass)
+ println(c)
+ println(c.typeSymbol == classToSymbol(mutant.getClass))
+}
diff --git a/test/pending/run/t5256h.check b/test/pending/run/t5256h.check
new file mode 100644
index 0000000000..4f9b8faf71
--- /dev/null
+++ b/test/pending/run/t5256h.check
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val mutant = new { val x = 2 }
+ val c = classToType(mutant.getClass)
+ println(c)
+ println(c.typeSymbol == classToSymbol(mutant.getClass))
+}
diff --git a/test/pending/run/t5256h.scala b/test/pending/run/t5256h.scala
new file mode 100644
index 0000000000..4f9b8faf71
--- /dev/null
+++ b/test/pending/run/t5256h.scala
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val mutant = new { val x = 2 }
+ val c = classToType(mutant.getClass)
+ println(c)
+ println(c.typeSymbol == classToSymbol(mutant.getClass))
+}
diff --git a/test/pending/run/t5258b.check b/test/pending/run/t5258b.check
new file mode 100644
index 0000000000..283b4225fb
--- /dev/null
+++ b/test/pending/run/t5258b.check
@@ -0,0 +1 @@
+TBI \ No newline at end of file
diff --git a/test/pending/run/t5258b.scala b/test/pending/run/t5258b.scala
new file mode 100644
index 0000000000..70cb4a7f4e
--- /dev/null
+++ b/test/pending/run/t5258b.scala
@@ -0,0 +1,15 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val code = scala.reflect.Code.lift{
+ class C
+ println(classOf[C])
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+} \ No newline at end of file
diff --git a/test/pending/run/t5258c.check b/test/pending/run/t5258c.check
new file mode 100644
index 0000000000..283b4225fb
--- /dev/null
+++ b/test/pending/run/t5258c.check
@@ -0,0 +1 @@
+TBI \ No newline at end of file
diff --git a/test/pending/run/t5258c.scala b/test/pending/run/t5258c.scala
new file mode 100644
index 0000000000..a93170d0d6
--- /dev/null
+++ b/test/pending/run/t5258c.scala
@@ -0,0 +1,15 @@
+import scala.tools.nsc.reporters._
+import scala.tools.nsc.Settings
+import reflect.runtime.Mirror.ToolBox
+
+object Test extends App {
+ val code = scala.reflect.Code.lift{
+ object E extends Enumeration { val foo, bar = Value }
+ println(E.foo)
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+} \ No newline at end of file
diff --git a/test/pending/run/t5427a.check b/test/pending/run/t5427a.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/pending/run/t5427a.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/pending/run/t5427a.scala b/test/pending/run/t5427a.scala
new file mode 100644
index 0000000000..27b28da0ac
--- /dev/null
+++ b/test/pending/run/t5427a.scala
@@ -0,0 +1,10 @@
+import scala.reflect.mirror._
+
+object Foo { val bar = 2 }
+
+object Test extends App {
+ val tpe = getType(Foo)
+ val bar = tpe.nonPrivateMember(newTermName("bar"))
+ val value = getValue(Foo, bar)
+ println(value)
+} \ No newline at end of file
diff --git a/test/pending/run/t5427b.check b/test/pending/run/t5427b.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/pending/run/t5427b.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/pending/run/t5427b.scala b/test/pending/run/t5427b.scala
new file mode 100644
index 0000000000..7a92b6ebbe
--- /dev/null
+++ b/test/pending/run/t5427b.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+class Foo { val bar = 2 }
+
+object Test extends App {
+ val foo = new Foo
+ val tpe = getType(foo)
+ val bar = tpe.nonPrivateMember(newTermName("bar"))
+ val value = getValue(foo, bar)
+ println(value)
+} \ No newline at end of file
diff --git a/test/pending/run/t5427c.check b/test/pending/run/t5427c.check
new file mode 100644
index 0000000000..32c91abbd6
--- /dev/null
+++ b/test/pending/run/t5427c.check
@@ -0,0 +1 @@
+no public member \ No newline at end of file
diff --git a/test/pending/run/t5427c.scala b/test/pending/run/t5427c.scala
new file mode 100644
index 0000000000..ab41d8b8cd
--- /dev/null
+++ b/test/pending/run/t5427c.scala
@@ -0,0 +1,13 @@
+import scala.reflect.mirror._
+
+class Foo(bar: Int)
+
+object Test extends App {
+ val foo = new Foo(2)
+ val tpe = getType(foo)
+ val bar = tpe.nonPrivateMember(newTermName("bar"))
+ bar match {
+ case NoSymbol => println("no public member")
+ case _ => println("i'm screwed")
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/t5427d.check b/test/pending/run/t5427d.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/pending/run/t5427d.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/pending/run/t5427d.scala b/test/pending/run/t5427d.scala
new file mode 100644
index 0000000000..fd4c62e876
--- /dev/null
+++ b/test/pending/run/t5427d.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+class Foo(val bar: Int)
+
+object Test extends App {
+ val foo = new Foo(2)
+ val tpe = getType(foo)
+ val bar = tpe.nonPrivateMember(newTermName("bar"))
+ val value = getValue(foo, bar)
+ println(value)
+} \ No newline at end of file