From 910aa4b4b6b1db98148566ca0b46e026fd5e312d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 25 Aug 2016 14:27:12 +0200 Subject: More tests recategorized --- tests/disabled/not-representable/pos/t8111.scala | 25 ++++++++++++++++++++++++ tests/disabled/typetags/pos/t8237b.scala | 10 ++++++++++ tests/neg/t8002-nested-scope.scala | 20 +++++++++++++++++++ tests/pending/pos/infersingle.flags | 1 - tests/pending/pos/t8002-nested-scope.scala | 20 ------------------- tests/pending/pos/t8111.scala | 24 ----------------------- tests/pending/pos/t8237b.scala | 10 ---------- tests/pending/pos/trait-force-info.flags | 1 - 8 files changed, 55 insertions(+), 56 deletions(-) create mode 100644 tests/disabled/not-representable/pos/t8111.scala create mode 100644 tests/disabled/typetags/pos/t8237b.scala create mode 100644 tests/neg/t8002-nested-scope.scala delete mode 100644 tests/pending/pos/infersingle.flags delete mode 100644 tests/pending/pos/t8002-nested-scope.scala delete mode 100644 tests/pending/pos/t8111.scala delete mode 100644 tests/pending/pos/t8237b.scala delete mode 100644 tests/pending/pos/trait-force-info.flags diff --git a/tests/disabled/not-representable/pos/t8111.scala b/tests/disabled/not-representable/pos/t8111.scala new file mode 100644 index 000000000..04a8e20de --- /dev/null +++ b/tests/disabled/not-representable/pos/t8111.scala @@ -0,0 +1,25 @@ +// structural types, cannot represent +trait T { + + def crashy(ma: Any): Unit = { + // okay + val f1 = (u: Unit) => ma + foo(f1)() + foo((u: Unit) => ma) + foo(0, (u: Any) => ma) apply () + + // crash due to side effects on the onwer of the symbol in the + // qualifier or arguments of the application during an abandoned + // names/defaults transform. The code type checkes because of + // autp-tupling which promotes and empty parmater list to `(): Unit` + foo((u: Any) => ma)() + + {{(u: Any) => ma}; this}.foo(0)() + + foo({def foo = ma; 0})() + + {def foo = ma; this}.foo(0)() + } + + def foo(f: Any): Any => Any +} diff --git a/tests/disabled/typetags/pos/t8237b.scala b/tests/disabled/typetags/pos/t8237b.scala new file mode 100644 index 000000000..52bb310e8 --- /dev/null +++ b/tests/disabled/typetags/pos/t8237b.scala @@ -0,0 +1,10 @@ +import scala.language.higherKinds +import scala.reflect.runtime.universe._ +object Test { + + def fTt[A,E[X]<:List[X]](a: A)(implicit tt: TypeTag[E[A]]) = a + + trait TC[A] + implicit def TCListInt[A]: TC[A] = ??? + fTt(1) +} diff --git a/tests/neg/t8002-nested-scope.scala b/tests/neg/t8002-nested-scope.scala new file mode 100644 index 000000000..78a03ce66 --- /dev/null +++ b/tests/neg/t8002-nested-scope.scala @@ -0,0 +1,20 @@ +// This test serves to capture the status quo, but should really +// emit an accessibiltiy error. + +// `Namers#companionSymbolOf` seems too lenient, and currently doesn't +// implement the same-scope checks mentioned: +// +// https://github.com/scala/scala/pull/2816#issuecomment-22555206 +// +class C { + def foo = { + class C { private def x = 0 } + + { + val a = 0 + object C { + new C().x // error: cannot be accessed + } + } + } +} diff --git a/tests/pending/pos/infersingle.flags b/tests/pending/pos/infersingle.flags deleted file mode 100644 index e1b37447c..000000000 --- a/tests/pending/pos/infersingle.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental \ No newline at end of file diff --git a/tests/pending/pos/t8002-nested-scope.scala b/tests/pending/pos/t8002-nested-scope.scala deleted file mode 100644 index a2088bce7..000000000 --- a/tests/pending/pos/t8002-nested-scope.scala +++ /dev/null @@ -1,20 +0,0 @@ -// This test serves to capture the status quo, but should really -// emit an accessibiltiy error. - -// `Namers#companionSymbolOf` seems too lenient, and currently doesn't -// implement the same-scope checks mentioned: -// -// https://github.com/scala/scala/pull/2816#issuecomment-22555206 -// -class C { - def foo = { - class C { private def x = 0 } - - { - val a = 0 - object C { - new C().x - } - } - } -} diff --git a/tests/pending/pos/t8111.scala b/tests/pending/pos/t8111.scala deleted file mode 100644 index 3f0e766ce..000000000 --- a/tests/pending/pos/t8111.scala +++ /dev/null @@ -1,24 +0,0 @@ -trait T { - - def crashy(ma: Any): Unit = { - // okay - val f1 = (u: Unit) => ma - foo(f1)() - foo((u: Unit) => ma) - foo(0, (u: Any) => ma) apply () - - // crash due to side effects on the onwer of the symbol in the - // qualifier or arguments of the application during an abandoned - // names/defaults transform. The code type checkes because of - // autp-tupling which promotes and empty parmater list to `(): Unit` - foo((u: Any) => ma)() - - {{(u: Any) => ma}; this}.foo(0)() - - foo({def foo = ma; 0})() - - {def foo = ma; this}.foo(0)() - } - - def foo(f: Any): Any => Any -} diff --git a/tests/pending/pos/t8237b.scala b/tests/pending/pos/t8237b.scala deleted file mode 100644 index 52bb310e8..000000000 --- a/tests/pending/pos/t8237b.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.language.higherKinds -import scala.reflect.runtime.universe._ -object Test { - - def fTt[A,E[X]<:List[X]](a: A)(implicit tt: TypeTag[E[A]]) = a - - trait TC[A] - implicit def TCListInt[A]: TC[A] = ??? - fTt(1) -} diff --git a/tests/pending/pos/trait-force-info.flags b/tests/pending/pos/trait-force-info.flags deleted file mode 100644 index eb4d19bcb..000000000 --- a/tests/pending/pos/trait-force-info.flags +++ /dev/null @@ -1 +0,0 @@ --optimise \ No newline at end of file -- cgit v1.2.3