diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-04-04 01:15:30 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-01 13:27:42 +0200 |
commit | 06e1905aed315d5199936797c9e9493326b74595 (patch) | |
tree | db50094702d250935ecbafd465542d4c11adc5d5 /tests/untried/pos | |
parent | 411d5be477cc862b14d8938c591524d8bf37d4cd (diff) | |
download | dotty-06e1905aed315d5199936797c9e9493326b74595.tar.gz dotty-06e1905aed315d5199936797c9e9493326b74595.tar.bz2 dotty-06e1905aed315d5199936797c9e9493326b74595.zip |
Enable untried pos tests related to value classes
Each test needs to have its own package because pos_all will try to
compile the whole valueclasses directory at once.
Diffstat (limited to 'tests/untried/pos')
21 files changed, 0 insertions, 211 deletions
diff --git a/tests/untried/pos/delambdafy_t6260_method.check b/tests/untried/pos/delambdafy_t6260_method.check deleted file mode 100644 index f5cd6947d..000000000 --- a/tests/untried/pos/delambdafy_t6260_method.check +++ /dev/null @@ -1,13 +0,0 @@ -delambdafy_t6260_method.scala:3: error: bridge generated for member method apply: (bx: Object)Object in class map$extension1 -which overrides method apply: (v1: Object)Object in trait Function1 -clashes with definition of the member itself; -both have erased type (bx: Object)Object - ((bx: Box[X]) => new Box(f(bx.x)))(this) - ^ -delambdafy_t6260_method.scala:8: error: bridge generated for member method apply: (bx: Object)Object in class map21 -which overrides method apply: (v1: Object)Object in trait Function1 -clashes with definition of the member itself; -both have erased type (bx: Object)Object - ((bx: Box[X]) => new Box(f(bx.x)))(self) - ^ -two errors found diff --git a/tests/untried/pos/delambdafy_t6260_method.flags b/tests/untried/pos/delambdafy_t6260_method.flags deleted file mode 100644 index 48b438ddf..000000000 --- a/tests/untried/pos/delambdafy_t6260_method.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/tests/untried/pos/delambdafy_t6260_method.scala b/tests/untried/pos/delambdafy_t6260_method.scala deleted file mode 100644 index 8edfe4ac3..000000000 --- a/tests/untried/pos/delambdafy_t6260_method.scala +++ /dev/null @@ -1,17 +0,0 @@ -class Box[X](val x: X) extends AnyVal { - def map[Y](f: X => Y): Box[Y] = - ((bx: Box[X]) => new Box(f(bx.x)))(this) -} - -object Test { - def map2[X, Y](self: Box[X], f: X => Y): Box[Y] = - ((bx: Box[X]) => new Box(f(bx.x)))(self) - - def main(args: Array[String]): Unit = { - val f = (x: Int) => x + 1 - val g = (x: String) => x + x - - map2(new Box(42), f) - new Box("abc") map g - } -} diff --git a/tests/untried/pos/t5853.scala b/tests/untried/pos/t5853.scala deleted file mode 100644 index 2ebb6667d..000000000 --- a/tests/untried/pos/t5853.scala +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - -final class C(val x: Int) extends AnyVal { - def ppp[@specialized(Int) T](y: T) = () -} - - -class Foo { - def f = new C(1) ppp 2 -} - - -/* Original SI-5853 test-case. */ - -object Bippy { - implicit final class C(val x: Int) extends AnyVal { - def +++[@specialized T](y: T) = () - } - def f = 1 +++ 2 -} - - -/* Few more examples. */ - -final class C2(val x: Int) extends AnyVal { - def +++[@specialized(Int) T](y: T) = () -} - - -class Foo2 { - def f = new C2(1) +++ 2 -} - - -object Arrow { - implicit final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal { - @inline def ->>[B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y) - } - - def foo = 1 ->> 2 -} - - -object SpecArrow { - implicit final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal { - @inline def ->> [@specialized(Int) B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y) - } - - def foo = 1 ->> 2 -} diff --git a/tests/untried/pos/t6029.scala b/tests/untried/pos/t6029.scala deleted file mode 100644 index 8f1bbb4eb..000000000 --- a/tests/untried/pos/t6029.scala +++ /dev/null @@ -1,3 +0,0 @@ -final case class V[A](x: A) extends AnyVal { - def flatMap[B](f: A => V[B]) = if (true) this else f(x) -} diff --git a/tests/untried/pos/t6034.scala b/tests/untried/pos/t6034.scala deleted file mode 100644 index 3558d7ff0..000000000 --- a/tests/untried/pos/t6034.scala +++ /dev/null @@ -1 +0,0 @@ -final class OptPlus[+A](val x: A) extends AnyVal { } diff --git a/tests/untried/pos/t6215.scala b/tests/untried/pos/t6215.scala deleted file mode 100644 index 2f66892b6..000000000 --- a/tests/untried/pos/t6215.scala +++ /dev/null @@ -1 +0,0 @@ -class Foo(val v: String) extends AnyVal { private def len = v.length ; def f = len } diff --git a/tests/untried/pos/t6260.flags b/tests/untried/pos/t6260.flags deleted file mode 100644 index 2349d8294..000000000 --- a/tests/untried/pos/t6260.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline diff --git a/tests/untried/pos/t6260.scala b/tests/untried/pos/t6260.scala deleted file mode 100644 index 8edfe4ac3..000000000 --- a/tests/untried/pos/t6260.scala +++ /dev/null @@ -1,17 +0,0 @@ -class Box[X](val x: X) extends AnyVal { - def map[Y](f: X => Y): Box[Y] = - ((bx: Box[X]) => new Box(f(bx.x)))(this) -} - -object Test { - def map2[X, Y](self: Box[X], f: X => Y): Box[Y] = - ((bx: Box[X]) => new Box(f(bx.x)))(self) - - def main(args: Array[String]): Unit = { - val f = (x: Int) => x + 1 - val g = (x: String) => x + x - - map2(new Box(42), f) - new Box("abc") map g - } -} diff --git a/tests/untried/pos/t6260b.scala b/tests/untried/pos/t6260b.scala deleted file mode 100644 index 73e2e58f7..000000000 --- a/tests/untried/pos/t6260b.scala +++ /dev/null @@ -1,3 +0,0 @@ - -class X(val value: Object) extends AnyVal { def or(alt: => X): X = this } -class Y { def f = new X("") or new X("") } diff --git a/tests/untried/pos/t6358.scala b/tests/untried/pos/t6358.scala deleted file mode 100644 index 25539c885..000000000 --- a/tests/untried/pos/t6358.scala +++ /dev/null @@ -1,6 +0,0 @@ -class L(val t: Int) extends AnyVal { - def lazyString = { - lazy val x = t.toString - () => x - } -} diff --git a/tests/untried/pos/t6358_2.scala b/tests/untried/pos/t6358_2.scala deleted file mode 100644 index 7c2beb60d..000000000 --- a/tests/untried/pos/t6358_2.scala +++ /dev/null @@ -1,6 +0,0 @@ -class Y[T](val i: Option[T]) extends AnyVal { - def q: List[T] = { - lazy val e: List[T] = i.toList - e - } -} diff --git a/tests/untried/pos/t6601/PrivateValueClass_1.scala b/tests/untried/pos/t6601/PrivateValueClass_1.scala deleted file mode 100644 index dc0137420..000000000 --- a/tests/untried/pos/t6601/PrivateValueClass_1.scala +++ /dev/null @@ -1 +0,0 @@ -class V private (val a: Any) extends AnyVal diff --git a/tests/untried/pos/t6601/UsePrivateValueClass_2.scala b/tests/untried/pos/t6601/UsePrivateValueClass_2.scala deleted file mode 100644 index ec9793751..000000000 --- a/tests/untried/pos/t6601/UsePrivateValueClass_2.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Test { - // After the first attempt to make seprately compiled value - // classes respect the privacy of constructors, we got: - // - // exception when typing v.a().==(v.a())/class scala.reflect.internal.Trees$Apply - // constructor V in class V cannot be accessed in object Test in file test/files/pos/t6601/UsePrivateValueClass_2.scala - // scala.reflect.internal.Types$TypeError: constructor V in class V cannot be accessed in object Test - def foo(v: V) = v.a == v.a - def bar(v: V) = v == v -} diff --git a/tests/untried/pos/t6651.scala b/tests/untried/pos/t6651.scala deleted file mode 100644 index 55a3b74e4..000000000 --- a/tests/untried/pos/t6651.scala +++ /dev/null @@ -1,33 +0,0 @@ -class YouAreYourself[A <: AnyRef](val you: A) extends AnyVal { - def yourself: you.type = you -} - -object Test { - val s = "" - val s1: s.type = new YouAreYourself[s.type](s).yourself -} - -trait Path { - type Dep <: AnyRef -} - -final class ValueClass[P <: Path](val path: P) extends AnyVal { - import path.Dep - - def apply(dep: Dep)(d2: dep.type, foo: Int): (Dep, d2.type) = (d2, d2) - - // This generates dodgy code; note `ValueClass.this`: - // - // final def bounds$extension[D >: Nothing <: ValueClass.this.path.Dep, - // P >: Nothing <: Path] - // ($this: ValueClass[P]) - // (dep: D) - // (d2: dep.type, foo: Int): (D, d2.type) = scala.Tuple2.apply[D, d2.type](d2, d2); - // - // Nothing crashes down the line, but it certainly doesn't conform to best-practices. - // - // An better alternative would be to add a type parameter for the (singleton) type of - // the wrapped value. - def bounds[D <: Dep](dep: D)(d2: dep.type, foo: Int): (D, d2.type) = (d2, d2) -} - diff --git a/tests/untried/pos/t7818.scala b/tests/untried/pos/t7818.scala deleted file mode 100644 index 77b99e7d5..000000000 --- a/tests/untried/pos/t7818.scala +++ /dev/null @@ -1,10 +0,0 @@ -class Observable1[+T](val asJava: JObservable[_ <: T]) extends AnyVal { - private def foo[X](a: JObservable[X]): JObservable[X] = ??? - // was generating a type error as the type of the RHS included an existential - // skolem based on the class type parameter `T`, which did not conform - // to the typer parameter of the extension method into which the RHS is - // transplanted. - def synchronize: Observable1[T] = new Observable1(foo(asJava)) -} - -class JObservable[T] diff --git a/tests/untried/pos/value-class-override-no-spec.flags b/tests/untried/pos/value-class-override-no-spec.flags deleted file mode 100644 index a7e64e4f0..000000000 --- a/tests/untried/pos/value-class-override-no-spec.flags +++ /dev/null @@ -1 +0,0 @@ --no-specialization
\ No newline at end of file diff --git a/tests/untried/pos/value-class-override-no-spec.scala b/tests/untried/pos/value-class-override-no-spec.scala deleted file mode 100644 index 79de5d930..000000000 --- a/tests/untried/pos/value-class-override-no-spec.scala +++ /dev/null @@ -1,9 +0,0 @@ -// There are two versions of this tests: one with and one without specialization. -// The bug was only exposed *without* specialization. -trait T extends Any { - def x: Any -} - -final class StringOps(val repr0: String) extends AnyVal with T { - def x = () -} diff --git a/tests/untried/pos/value-class-override-spec.scala b/tests/untried/pos/value-class-override-spec.scala deleted file mode 100644 index 79de5d930..000000000 --- a/tests/untried/pos/value-class-override-spec.scala +++ /dev/null @@ -1,9 +0,0 @@ -// There are two versions of this tests: one with and one without specialization. -// The bug was only exposed *without* specialization. -trait T extends Any { - def x: Any -} - -final class StringOps(val repr0: String) extends AnyVal with T { - def x = () -} diff --git a/tests/untried/pos/xlint1.flags b/tests/untried/pos/xlint1.flags deleted file mode 100644 index 7949c2afa..000000000 --- a/tests/untried/pos/xlint1.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings diff --git a/tests/untried/pos/xlint1.scala b/tests/untried/pos/xlint1.scala deleted file mode 100644 index 27936d8b1..000000000 --- a/tests/untried/pos/xlint1.scala +++ /dev/null @@ -1,13 +0,0 @@ -package object foo { - implicit class Bar[T](val x: T) extends AnyVal { - def bippy = 1 - } -} - -package foo { - object Baz { - def main(args: Array[String]): Unit = { - "abc".bippy - } - } -} |