diff options
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t2868.cmds | 3 | ||||
-rw-r--r-- | test/files/pos/t2868/Jann.java | 5 | ||||
-rw-r--r-- | test/files/pos/t2868/Nest.java | 3 | ||||
-rw-r--r-- | test/files/pos/t2868/pick_1.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t2868/t2868_src_2.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t6047.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t6259.scala | 47 | ||||
-rw-r--r-- | test/files/pos/t6335.scala | 25 | ||||
-rw-r--r-- | test/files/pos/t6367.scala | 34 | ||||
-rw-r--r-- | test/files/pos/z1720.scala | 16 |
10 files changed, 125 insertions, 27 deletions
diff --git a/test/files/pos/t2868.cmds b/test/files/pos/t2868.cmds deleted file mode 100644 index ed8124a9e0..0000000000 --- a/test/files/pos/t2868.cmds +++ /dev/null @@ -1,3 +0,0 @@ -javac Jann.java Nest.java -scalac pick_1.scala -scalac test_2.scala diff --git a/test/files/pos/t2868/Jann.java b/test/files/pos/t2868/Jann.java deleted file mode 100644 index f5b68de7b0..0000000000 --- a/test/files/pos/t2868/Jann.java +++ /dev/null @@ -1,5 +0,0 @@ -public @interface Jann { - public String str(); - public Nest inn(); - public int[] arr(); -} diff --git a/test/files/pos/t2868/Nest.java b/test/files/pos/t2868/Nest.java deleted file mode 100644 index 53652291ad..0000000000 --- a/test/files/pos/t2868/Nest.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface Nest { - public int value(); -} diff --git a/test/files/pos/t2868/pick_1.scala b/test/files/pos/t2868/pick_1.scala deleted file mode 100644 index a211687432..0000000000 --- a/test/files/pos/t2868/pick_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -class ann(s: String) extends annotation.StaticAnnotation -class pick { - final val s = "bang!" - @ann("bang!") def foo = 1 - @Jann(str = "bang!", inn = new Nest(1), arr = Array(1, 2)) def bar = 2 - @Jann(str = "bang!", inn = new Nest(1), arr = Array(1, 2)) def baz = 3 -} diff --git a/test/files/pos/t2868/t2868_src_2.scala b/test/files/pos/t2868/t2868_src_2.scala deleted file mode 100644 index f11ef0fae2..0000000000 --- a/test/files/pos/t2868/t2868_src_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -class test { - val l = (new pick).s - val u = (new pick).foo - val c = (new pick).bar - val k = (new pick).baz -} diff --git a/test/files/pos/t6047.scala b/test/files/pos/t6047.scala index 80d5e9668b..bc5f856bd2 100644 --- a/test/files/pos/t6047.scala +++ b/test/files/pos/t6047.scala @@ -4,17 +4,17 @@ import java.io.InputStream object Macros { def unpack[A](input: InputStream): A = macro unpack_impl[A] - def unpack_impl[A: c.AbsTypeTag](c: Context)(input: c.Expr[InputStream]): c.Expr[A] = { + def unpack_impl[A: c.WeakTypeTag](c: Context)(input: c.Expr[InputStream]): c.Expr[A] = { import c.universe._ def unpackcode(tpe: c.Type): c.Expr[_] = { - if (tpe <:< implicitly[c.AbsTypeTag[Traversable[_]]].tpe) { + if (tpe <:< implicitly[c.WeakTypeTag[Traversable[_]]].tpe) { } ??? } - unpackcode(implicitly[c.AbsTypeTag[A]].tpe) + unpackcode(implicitly[c.WeakTypeTag[A]].tpe) ??? } }
\ No newline at end of file diff --git a/test/files/pos/t6259.scala b/test/files/pos/t6259.scala new file mode 100644 index 0000000000..43361c417e --- /dev/null +++ b/test/files/pos/t6259.scala @@ -0,0 +1,47 @@ +package t6259 + +import scala.reflect.runtime.universe._ + +class A[X](implicit val tt: TypeTag[X]) {} +object B extends A[String] + +object C { + object D extends A[String] +} + +trait E { + object F extends A[String] +} + +class G { + object H extends A[String] +} + +object Test { + val x = { + object InVal extends A[String] + 5 + } + +} + +// Note: Both of these fail right now. + +trait NeedsEarly { + val x: AnyRef +} + +object Early extends { + // Drops to this.getClass and is not ok... + val x = { object EarlyOk extends A[String]; EarlyOk } +} with NeedsEarly + + +class DoubleTrouble[X](x: AnyRef)(implicit override val tt: TypeTag[X]) extends A[X] + +object DoubleOk extends DoubleTrouble[String]({ + // Drops to this.getClass and is an issue + object InnerTrouble extends A[String]; + InnerTrouble +}) + diff --git a/test/files/pos/t6335.scala b/test/files/pos/t6335.scala new file mode 100644 index 0000000000..50e34092d1 --- /dev/null +++ b/test/files/pos/t6335.scala @@ -0,0 +1,25 @@ +object E extends Z { + def X = 3 + implicit class X(val i: Int) { + def xx = i + } + + def Y(a: Any) = 0 + object Y + implicit class Y(val i: String) { def yy = i } + + implicit class Z(val i: Boolean) { def zz = i } +} + +trait Z { + def Z = 0 +} + +object Test { + import E._ + 0.xx + + "".yy + + true.zz +} diff --git a/test/files/pos/t6367.scala b/test/files/pos/t6367.scala new file mode 100644 index 0000000000..1214be7418 --- /dev/null +++ b/test/files/pos/t6367.scala @@ -0,0 +1,34 @@ +package play.api.libs.json.util + +trait FunctionalCanBuild[M[_]]{ + def apply[A,B](ma:M[A], mb:M[B]):M[A ~ B] +} + +trait Variant[M[_]] + +trait Functor[M[_]] extends Variant[M]{ + def fmap[A,B](m:M[A], f: A => B): M[B] +} + +case class ~[A,B](_1:A,_2:B) + +class FunctionalBuilder[M[_]](canBuild:FunctionalCanBuild[M]){ + class CanBuild20[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20]( + m1:M[A1 ~ A2 ~ A3 ~ A4 ~ A5 ~ A6 ~ A7 ~ A8 ~ A9 ~ A10 ~ A11 ~ A12 ~ A13 ~ A14 ~ A15 ~ A16 ~ A17 ~ A18 ~ A19], + m2:M[A20] + ) { + + def ~[A21](m3:M[A21]) = new CanBuild21(canBuild(m1,m2),m3) + + def apply[B](f: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) => B)(implicit fu:Functor[M]): M[B] = + fu.fmap[A1 ~ A2 ~ A3 ~ A4 ~ A5 ~ A6 ~ A7 ~ A8 ~ A9 ~ A10 ~ A11 ~ A12 ~ A13 ~ A14 ~ A15 ~ A16 ~ A17 ~ A18 ~ A19 ~ A20, B]( + canBuild(m1, m2), + { case a1 ~ a2 ~ a3 ~ a4 ~ a5 ~ a6 ~ a7 ~ a8 ~ a9 ~ a10 ~ a11 ~ a12 ~ a13 ~ a14 ~ a15 ~ a16 ~ a17 ~ a18 ~ a19 ~ a20 => + f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) } + ) + } + + class CanBuild21[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21](m1:M[A1 ~ A2 ~ A3 ~ A4 ~ A5 ~ A6 ~ A7 ~ A8 ~ A9 ~ A10 ~ A11 ~ A12 ~ A13 ~ A14 ~ A15 ~ A16 ~ A17 ~ A18 ~ A19 ~ A20], m2:M[A21]){ + } + +} diff --git a/test/files/pos/z1720.scala b/test/files/pos/z1720.scala new file mode 100644 index 0000000000..7394d428c1 --- /dev/null +++ b/test/files/pos/z1720.scala @@ -0,0 +1,16 @@ +package test + +class Thing { + def info: Info[this.type] = InfoRepository.getInfo(this) + def info2: Info[this.type] = { + def self: this.type = this + InfoRepository.getInfo(self) + } +} + +trait Info[T] +case class InfoImpl[T](thing: T) extends Info[T] + +object InfoRepository { + def getInfo(t: Thing): Info[t.type] = InfoImpl(t) +} |