diff options
author | Paul Phillips <paulp@improving.org> | 2013-06-03 22:13:38 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-06-03 22:13:38 -0700 |
commit | e317d0bcc9fa8f2a2e6d93c4ad5edf5326f5a617 (patch) | |
tree | 49f3009e24ebc993d390f3aecb9ed597d9931ee8 /test | |
parent | 1472dadd03496aa89624c81ded01edeb71420cc3 (diff) | |
parent | 60d462ef6e0dba5f9a7c4cc81255fcb9fba7939a (diff) | |
download | scala-e317d0bcc9fa8f2a2e6d93c4ad5edf5326f5a617.tar.gz scala-e317d0bcc9fa8f2a2e6d93c4ad5edf5326f5a617.tar.bz2 scala-e317d0bcc9fa8f2a2e6d93c4ad5edf5326f5a617.zip |
Merge remote-tracking branch 'origin/2.10.2' into pr/merge
* origin/2.10.2:
SI-7532 Fix regression in Java inner classfile reader
SI-7517 Fix higher kinded type inference regression
SI-7516 Revert "SI-7234 Make named args play nice w. depmet types"
SI-7486 Regressions in implicit search.
SI-7509 Avoid crasher as erronous args flow through NamesDefaults
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t7509.check | 12 | ||||
-rw-r--r-- | test/files/neg/t7509.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t7516/A_1.scala | 9 | ||||
-rw-r--r-- | test/files/pos/t7516/B_2.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t7517.scala | 22 | ||||
-rw-r--r-- | test/files/pos/t7532/A_1.java | 6 | ||||
-rw-r--r-- | test/files/pos/t7532/B_2.scala | 5 | ||||
-rw-r--r-- | test/files/pos/t7532b/A_1.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t7532b/B_2.scala | 8 | ||||
-rw-r--r-- | test/pending/neg/t7441.check (renamed from test/files/neg/t7441.check) | 0 | ||||
-rw-r--r-- | test/pending/neg/t7441.scala (renamed from test/files/neg/t7441.scala) | 0 | ||||
-rw-r--r-- | test/pending/pos/t7234.scala (renamed from test/files/pos/t7234.scala) | 0 | ||||
-rw-r--r-- | test/pending/pos/t7234b.scala (renamed from test/files/pos/t7234b.scala) | 0 | ||||
-rw-r--r-- | test/pending/pos/t7486.scala (renamed from test/files/pos/t7486.scala) | 0 |
14 files changed, 77 insertions, 0 deletions
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/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 diff --git a/test/files/neg/t7441.check b/test/pending/neg/t7441.check index f259457197..f259457197 100644 --- a/test/files/neg/t7441.check +++ b/test/pending/neg/t7441.check diff --git a/test/files/neg/t7441.scala b/test/pending/neg/t7441.scala index dad7421e3f..dad7421e3f 100644 --- a/test/files/neg/t7441.scala +++ b/test/pending/neg/t7441.scala diff --git a/test/files/pos/t7234.scala b/test/pending/pos/t7234.scala index 59a233d835..59a233d835 100644 --- a/test/files/pos/t7234.scala +++ b/test/pending/pos/t7234.scala diff --git a/test/files/pos/t7234b.scala b/test/pending/pos/t7234b.scala index fee98e87a8..fee98e87a8 100644 --- a/test/files/pos/t7234b.scala +++ b/test/pending/pos/t7234b.scala diff --git a/test/files/pos/t7486.scala b/test/pending/pos/t7486.scala index 6dd7f4c4ac..6dd7f4c4ac 100644 --- a/test/files/pos/t7486.scala +++ b/test/pending/pos/t7486.scala |