summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-08-26 09:29:35 -0700
committerJames Iry <jamesiry@gmail.com>2013-08-26 09:29:35 -0700
commitba86ac61f489573d10590c5fc601e73673f204f1 (patch)
tree192ce37d6fad25c18b93408aaa31936ea687a711 /test/files
parent9600d2b7432ddde7c19ecf672ad3247615bd6475 (diff)
parentbc6d4b5c1d6746528fd442d8504f30909d7e6067 (diff)
downloadscala-ba86ac61f489573d10590c5fc601e73673f204f1.tar.gz
scala-ba86ac61f489573d10590c5fc601e73673f204f1.tar.bz2
scala-ba86ac61f489573d10590c5fc601e73673f204f1.zip
Merge pull request #2860 from retronym/merge/2.10.2-to-2.10.x
Merge/2.10.2 to 2.10.x
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t7441.check6
-rw-r--r--test/files/neg/t7441.scala7
-rw-r--r--test/files/neg/t7509.check12
-rw-r--r--test/files/neg/t7509.scala4
-rw-r--r--test/files/pos/t7234.scala15
-rw-r--r--test/files/pos/t7234b.scala20
-rw-r--r--test/files/pos/t7486-named.scala8
-rw-r--r--test/files/pos/t7516/A_1.scala9
-rw-r--r--test/files/pos/t7516/B_2.scala4
-rw-r--r--test/files/pos/t7517.scala22
-rw-r--r--test/files/pos/t7532/A_1.java6
-rw-r--r--test/files/pos/t7532/B_2.scala5
-rw-r--r--test/files/pos/t7532b/A_1.scala7
-rw-r--r--test/files/pos/t7532b/B_2.scala8
14 files changed, 85 insertions, 48 deletions
diff --git a/test/files/neg/t7441.check b/test/files/neg/t7441.check
deleted file mode 100644
index f259457197..0000000000
--- a/test/files/neg/t7441.check
+++ /dev/null
@@ -1,6 +0,0 @@
-t7441.scala:4: error: type mismatch;
- found : Int(1)
- required: List[Any]
- def test = apply(1)
- ^
-one error found
diff --git a/test/files/neg/t7441.scala b/test/files/neg/t7441.scala
deleted file mode 100644
index dad7421e3f..0000000000
--- a/test/files/neg/t7441.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-object Test {
- object Bar {
- def apply(xs: List[Any]): Int = 0
- def test = apply(1)
- }
- implicit def foo = 1
-}
diff --git a/test/files/neg/t7509.check b/test/files/neg/t7509.check
new file mode 100644
index 0000000000..eaa6303cf5
--- /dev/null
+++ b/test/files/neg/t7509.check
@@ -0,0 +1,12 @@
+t7509.scala:3: error: inferred type arguments [Int] do not conform to method crash's type parameter bounds [R <: AnyRef]
+ crash(42)
+ ^
+t7509.scala:3: error: type mismatch;
+ found : Int(42)
+ required: R
+ crash(42)
+ ^
+t7509.scala:3: error: could not find implicit value for parameter ev: R
+ crash(42)
+ ^
+three errors found
diff --git a/test/files/neg/t7509.scala b/test/files/neg/t7509.scala
new file mode 100644
index 0000000000..3cba801ea7
--- /dev/null
+++ b/test/files/neg/t7509.scala
@@ -0,0 +1,4 @@
+object NMWE {
+ def crash[R <: AnyRef](f: R)(implicit ev: R): Any = ???
+ crash(42)
+}
diff --git a/test/files/pos/t7234.scala b/test/files/pos/t7234.scala
deleted file mode 100644
index 59a233d835..0000000000
--- a/test/files/pos/t7234.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-trait Main {
- trait A {
- type B
- }
- trait C {
- def c(a: A, x: Int = 0)(b: a.B)
- }
- def c: C
- def d(a: A, x: Int = 0)(b: a.B)
-
- def ok1(a: A)(b: a.B) = c.c(a, 42)(b)
- def ok2(a: A)(b: a.B) = d(a)(b)
-
- def fail(a: A)(b: a.B) = c.c(a)(b)
-}
diff --git a/test/files/pos/t7234b.scala b/test/files/pos/t7234b.scala
deleted file mode 100644
index fee98e87a8..0000000000
--- a/test/files/pos/t7234b.scala
+++ /dev/null
@@ -1,20 +0,0 @@
-trait Main {
- trait A {
- type B
- def b: B
- }
- trait C {
- def c(a: A, x: Int = 0)(b: => a.B, bs: a.B*)
- def d(a: A = null, x: Int = 0)(b1: => a.B = a.b, b2: a.B = a.b)
- }
- def c: C
- def ok(a: A)(b: a.B) = c.c(a, 42)(b)
- def fail(a: A)(b: a.B) = c.c(a)(b)
- def fail2(a: A)(b: a.B) = c.c(a)(b, b)
- def fail3(a: A)(b: a.B) = c.c(a)(b, Seq[a.B](b): _*)
-
- def fail4(a: A)(b: a.B) = c.d(a)()
- def fail5(a: A)(b: a.B) = c.d(a)(b1 = a.b)
- def fail6(a: A)(b: a.B) = c.d(a)(b2 = a.b)
- def fail7(a: A)(b: a.B) = c.d()()
-}
diff --git a/test/files/pos/t7486-named.scala b/test/files/pos/t7486-named.scala
new file mode 100644
index 0000000000..253293e5f1
--- /dev/null
+++ b/test/files/pos/t7486-named.scala
@@ -0,0 +1,8 @@
+
+object Test {
+ def fold(empty: Any) = ()
+ implicit val notAnnotatedImplicit = new {
+ fold(empty = 0)
+ def empty[A]: Any = ???
+ }
+}
diff --git a/test/files/pos/t7516/A_1.scala b/test/files/pos/t7516/A_1.scala
new file mode 100644
index 0000000000..3bba19966d
--- /dev/null
+++ b/test/files/pos/t7516/A_1.scala
@@ -0,0 +1,9 @@
+import scala.reflect._,macros._, scala.language.experimental.macros
+
+object A {
+ def impl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = {
+ val r = c.universe.reify { List(t.splice) }
+ c.Expr[List[T]]( c.resetLocalAttrs(r.tree) )
+ }
+ def demo[T](t: T): List[T] = macro impl[T]
+}
diff --git a/test/files/pos/t7516/B_2.scala b/test/files/pos/t7516/B_2.scala
new file mode 100644
index 0000000000..1b8531bc85
--- /dev/null
+++ b/test/files/pos/t7516/B_2.scala
@@ -0,0 +1,4 @@
+object B {
+ final case class CV(p: Int = 3, g: Int = 2)
+ A.demo { val d = 4; CV(g = d); "a" }
+}
diff --git a/test/files/pos/t7517.scala b/test/files/pos/t7517.scala
new file mode 100644
index 0000000000..7ce4c6b13e
--- /dev/null
+++ b/test/files/pos/t7517.scala
@@ -0,0 +1,22 @@
+trait Box[ K[A[x]] ]
+
+object Box {
+ // type constructor composition
+ sealed trait ∙[A[_], B[_]] { type l[T] = A[B[T]] }
+
+ // composes type constructors inside K
+ type SplitBox[K[A[x]], B[x]] = Box[ ({ type l[A[x]] = K[ (A ∙ B)#l] })#l ]
+
+ def split[ K[A[x]], B[x] ](base: Box[K]): SplitBox[K,B] = ???
+
+ class Composed[B[_], L[A[x]] ] {
+ val box: Box[L] = ???
+
+ type Split[ A[x] ] = L[ (A ∙ B)#l ]
+ val a: Box[Split] = Box.split(box)
+
+ //Either of these work:
+ val a1: Box[Split] = Box.split[L,B](box)
+ val a2: Box[ ({ type l[A[x]] = L[ (A ∙ B)#l ] })#l ] = Box.split(box)
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/t7532/A_1.java b/test/files/pos/t7532/A_1.java
new file mode 100644
index 0000000000..1ade76cc70
--- /dev/null
+++ b/test/files/pos/t7532/A_1.java
@@ -0,0 +1,6 @@
+class R {
+ public class attr { // Will have the bytecode name `R$attr`, not to be confused with `R@tr`!
+ }
+ public static class attr1 {
+ }
+}
diff --git a/test/files/pos/t7532/B_2.scala b/test/files/pos/t7532/B_2.scala
new file mode 100644
index 0000000000..ee7ce7751f
--- /dev/null
+++ b/test/files/pos/t7532/B_2.scala
@@ -0,0 +1,5 @@
+object Test {
+ val r = new R
+ new r.attr() // Was: error while loading attr, class file '.../t7532-pos.obj/R$attr.class' has location not matching its contents: contains class
+ new R.attr1
+} \ No newline at end of file
diff --git a/test/files/pos/t7532b/A_1.scala b/test/files/pos/t7532b/A_1.scala
new file mode 100644
index 0000000000..e8f9540609
--- /dev/null
+++ b/test/files/pos/t7532b/A_1.scala
@@ -0,0 +1,7 @@
+package pack
+class R {
+ class attr // Will have the bytecode name `R$attr`, not to be confused with `R@tr`!
+ class `@`
+}
+
+class `@` \ No newline at end of file
diff --git a/test/files/pos/t7532b/B_2.scala b/test/files/pos/t7532b/B_2.scala
new file mode 100644
index 0000000000..1555a5daa7
--- /dev/null
+++ b/test/files/pos/t7532b/B_2.scala
@@ -0,0 +1,8 @@
+import pack._
+
+object Test {
+ val r = new R
+ new r.attr()
+ new r.`@`
+ new `@`
+} \ No newline at end of file