aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/t0123.scala3
-rw-r--r--tests/pos/t0154.scala10
-rw-r--r--tests/pos/t0165.scala14
-rw-r--r--tests/pos/t0204.scala7
-rw-r--r--tests/pos/t0227.scala31
-rw-r--r--tests/pos/t0231.scala17
-rw-r--r--tests/pos/t0273.scala7
7 files changed, 89 insertions, 0 deletions
diff --git a/tests/pos/t0123.scala b/tests/pos/t0123.scala
new file mode 100644
index 000000000..79f0c907a
--- /dev/null
+++ b/tests/pos/t0123.scala
@@ -0,0 +1,3 @@
+class M{
+ val 1 = 1;
+}
diff --git a/tests/pos/t0154.scala b/tests/pos/t0154.scala
new file mode 100644
index 000000000..9fb943067
--- /dev/null
+++ b/tests/pos/t0154.scala
@@ -0,0 +1,10 @@
+package test
+trait MyMatchers {
+ val StringMatch = new AnyRef {}
+ trait Something {
+ (null : AnyRef) match {
+ case (StringMatch) =>
+ case _ =>
+ }
+ }
+}
diff --git a/tests/pos/t0165.scala b/tests/pos/t0165.scala
new file mode 100644
index 000000000..76aef8524
--- /dev/null
+++ b/tests/pos/t0165.scala
@@ -0,0 +1,14 @@
+package test3
+import scala.collection.mutable.LinkedHashMap
+
+trait Main {
+ def asMany : ArrayResult = {
+ object result extends LinkedHashMap[String,String] with ArrayResult {
+ def current = result
+ }
+ result
+ }
+ trait ArrayResult {
+ def current : scala.collection.Map[String,String]
+ }
+}
diff --git a/tests/pos/t0204.scala b/tests/pos/t0204.scala
new file mode 100644
index 000000000..23d36523e
--- /dev/null
+++ b/tests/pos/t0204.scala
@@ -0,0 +1,7 @@
+class A {
+ object B {
+ def f() = {
+ class C extends A {}; new C : A
+ }
+ }
+}
diff --git a/tests/pos/t0227.scala b/tests/pos/t0227.scala
new file mode 100644
index 000000000..806b20d40
--- /dev/null
+++ b/tests/pos/t0227.scala
@@ -0,0 +1,31 @@
+final class Settings {
+ def f[T](a_args: T*): List[T] = Nil
+}
+
+abstract class Factory {
+ type libraryType <: Base
+
+ final def apply(settings: Settings): libraryType = sys.error("bla")
+}
+
+abstract class Base {
+ val settings: Settings
+
+ protected val demands: List[Factory] = Nil
+}
+
+class SA(val settings: Settings) extends Base {
+ override val demands = List(
+ SD
+ ) ::: settings.f(
+ SC
+ )
+}
+
+object SC extends Factory {
+ type libraryType = Base
+}
+
+object SD extends Factory {
+ type libraryType = SA
+}
diff --git a/tests/pos/t0231.scala b/tests/pos/t0231.scala
new file mode 100644
index 000000000..0850d7a57
--- /dev/null
+++ b/tests/pos/t0231.scala
@@ -0,0 +1,17 @@
+class Foo {
+ def aaa: Unit = {
+ println("a")
+ }
+}
+
+class Bar extends Foo {
+ object b {
+ //println("b: " + a) //OK
+ println("b: " + Bar.super.aaa)
+ }
+}
+
+object bug extends App {
+ new Bar
+ ()
+}
diff --git a/tests/pos/t0273.scala b/tests/pos/t0273.scala
new file mode 100644
index 000000000..10f426828
--- /dev/null
+++ b/tests/pos/t0273.scala
@@ -0,0 +1,7 @@
+class A
+
+object Test {
+def a = () => ()
+def a[T] = (p:A) => ()
+def main(args: Array[String]) = ()
+}