diff options
Diffstat (limited to 'test')
220 files changed, 2216 insertions, 1316 deletions
diff --git a/test/files/jvm/future-spec/FutureTests.scala b/test/files/jvm/future-spec/FutureTests.scala index 9a9cf951bb..e5e01a5954 100644 --- a/test/files/jvm/future-spec/FutureTests.scala +++ b/test/files/jvm/future-spec/FutureTests.scala @@ -19,7 +19,7 @@ object FutureTests extends MinimalScalaTest { case "NoReply" => Promise[String]().future } - val defaultTimeout = Inf + val defaultTimeout = 5 seconds /* future specification */ diff --git a/test/files/jvm/future-spec/PromiseTests.scala b/test/files/jvm/future-spec/PromiseTests.scala index 6016746a23..bf9d9b39d7 100644 --- a/test/files/jvm/future-spec/PromiseTests.scala +++ b/test/files/jvm/future-spec/PromiseTests.scala @@ -133,7 +133,7 @@ object PromiseTests extends MinimalScalaTest { (future, result) => intercept[NoSuchElementException] { Await.result(future.failed, defaultTimeout) - }.getMessage mustBe ("Future.failed not completed with a throwable. Instead completed with: " + result) + }.getMessage mustBe ("Future.failed not completed with a throwable.") } } diff --git a/test/files/jvm/interpreter.scala b/test/files/jvm/interpreter.scala index 755b2ac9ae..f45eb034a9 100644 --- a/test/files/jvm/interpreter.scala +++ b/test/files/jvm/interpreter.scala @@ -147,7 +147,7 @@ def f(e: Exp) = e match {{ // non-exhaustive warning here def appendix() = { val settings = new Settings settings.classpath.value = sys.props("java.class.path") - val interp = new Interpreter(settings) + val interp = new interpreter.IMain(settings) interp.interpret("def plusOne(x: Int) = x + 1") interp.interpret("plusOne(5)") interp.reset() diff --git a/test/files/jvm/manifests-new.check b/test/files/jvm/manifests-new.check index 9fca856970..896a5c1cef 100644 --- a/test/files/jvm/manifests-new.check +++ b/test/files/jvm/manifests-new.check @@ -1,58 +1,58 @@ -x=(), t=ConcreteTypeTag[Unit], k=TypeRef, s=class Unit
-x=true, t=ConcreteTypeTag[Boolean], k=TypeRef, s=class Boolean
-x=a, t=ConcreteTypeTag[Char], k=TypeRef, s=class Char
-x=1, t=ConcreteTypeTag[Int], k=TypeRef, s=class Int
-x=abc, t=ConcreteTypeTag[String], k=TypeRef, s=class String
-x='abc, t=ConcreteTypeTag[Symbol], k=TypeRef, s=class Symbol
-
-x=List(()), t=ConcreteTypeTag[List[Unit]], k=TypeRef, s=class List
-x=List(true), t=ConcreteTypeTag[List[Boolean]], k=TypeRef, s=class List
-x=List(1), t=ConcreteTypeTag[List[Int]], k=TypeRef, s=class List
-x=List(abc), t=ConcreteTypeTag[List[String]], k=TypeRef, s=class List
-x=List('abc), t=ConcreteTypeTag[List[Symbol]], k=TypeRef, s=class List
-
-x=[Z, t=ConcreteTypeTag[Array[Boolean]], k=TypeRef, s=class Array
-x=[C, t=ConcreteTypeTag[Array[Char]], k=TypeRef, s=class Array
-x=[I, t=ConcreteTypeTag[Array[Int]], k=TypeRef, s=class Array
-x=[Ljava.lang.String;, t=ConcreteTypeTag[Array[String]], k=TypeRef, s=class Array
-x=[Lscala.Symbol;, t=ConcreteTypeTag[Array[Symbol]], k=TypeRef, s=class Array
-
-x=((),()), t=ConcreteTypeTag[(Unit, Unit)], k=TypeRef, s=class Tuple2
-x=(true,false), t=ConcreteTypeTag[(Boolean, Boolean)], k=TypeRef, s=class Tuple2
-x=(1,2), t=ConcreteTypeTag[(Int, Int)], k=TypeRef, s=class Tuple2
-x=(abc,xyz), t=ConcreteTypeTag[(String, String)], k=TypeRef, s=class Tuple2
-x=('abc,'xyz), t=ConcreteTypeTag[(Symbol, Symbol)], k=TypeRef, s=class Tuple2
-
-x=Test$, t=ConcreteTypeTag[Test.type], k=TypeRef, s=object Test
-x=scala.collection.immutable.List$, t=ConcreteTypeTag[scala.collection.immutable.List.type], k=TypeRef, s=object List
-
-x=Foo, t=ConcreteTypeTag[Foo[Int]], k=TypeRef, s=class Foo
-x=Foo, t=ConcreteTypeTag[Foo[List[Int]]], k=TypeRef, s=class Foo
-x=Foo, t=ConcreteTypeTag[Foo[Foo[Int]]], k=TypeRef, s=class Foo
-x=Foo, t=ConcreteTypeTag[Foo[List[Foo[Int]]]], k=TypeRef, s=class Foo
-
-x=Test1$$anon$1, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
-x=Test1$$anon$2, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
-
-()=()
-true=true
-a=a
-1=1
-'abc='abc
-
-List(())=List(())
-List(true)=List(true)
-List('abc)=List('abc)
-
-Array()=Array()
-Array(true)=Array(true)
-Array(a)=Array(a)
-Array(1)=Array(1)
-
-((),())=((),())
-(true,false)=(true,false)
-
-List(List(1), List(2))=List(List(1), List(2))
-
-Array(Array(1), Array(2))=Array(Array(1), Array(2))
-
+x=(), t=ConcreteTypeTag[Unit], k=TypeRef, s=class Unit +x=true, t=ConcreteTypeTag[Boolean], k=TypeRef, s=class Boolean +x=a, t=ConcreteTypeTag[Char], k=TypeRef, s=class Char +x=1, t=ConcreteTypeTag[Int], k=TypeRef, s=class Int +x=abc, t=ConcreteTypeTag[String], k=TypeRef, s=class String +x='abc, t=ConcreteTypeTag[Symbol], k=TypeRef, s=class Symbol + +x=List(()), t=ConcreteTypeTag[List[Unit]], k=TypeRef, s=class List +x=List(true), t=ConcreteTypeTag[List[Boolean]], k=TypeRef, s=class List +x=List(1), t=ConcreteTypeTag[List[Int]], k=TypeRef, s=class List +x=List(abc), t=ConcreteTypeTag[List[String]], k=TypeRef, s=class List +x=List('abc), t=ConcreteTypeTag[List[Symbol]], k=TypeRef, s=class List + +x=[Z, t=ConcreteTypeTag[Array[Boolean]], k=TypeRef, s=class Array +x=[C, t=ConcreteTypeTag[Array[Char]], k=TypeRef, s=class Array +x=[I, t=ConcreteTypeTag[Array[Int]], k=TypeRef, s=class Array +x=[Ljava.lang.String;, t=ConcreteTypeTag[Array[String]], k=TypeRef, s=class Array +x=[Lscala.Symbol;, t=ConcreteTypeTag[Array[Symbol]], k=TypeRef, s=class Array + +x=((),()), t=ConcreteTypeTag[(Unit, Unit)], k=TypeRef, s=class Tuple2 +x=(true,false), t=ConcreteTypeTag[(Boolean, Boolean)], k=TypeRef, s=class Tuple2 +x=(1,2), t=ConcreteTypeTag[(Int, Int)], k=TypeRef, s=class Tuple2 +x=(abc,xyz), t=ConcreteTypeTag[(String, String)], k=TypeRef, s=class Tuple2 +x=('abc,'xyz), t=ConcreteTypeTag[(Symbol, Symbol)], k=TypeRef, s=class Tuple2 + +x=Test$, t=ConcreteTypeTag[Test.type], k=SingleType, s=object Test +x=scala.collection.immutable.List$, t=ConcreteTypeTag[scala.collection.immutable.List.type], k=SingleType, s=object List + +x=Foo, t=ConcreteTypeTag[Foo[Int]], k=TypeRef, s=class Foo +x=Foo, t=ConcreteTypeTag[Foo[List[Int]]], k=TypeRef, s=class Foo +x=Foo, t=ConcreteTypeTag[Foo[Foo[Int]]], k=TypeRef, s=class Foo +x=Foo, t=ConcreteTypeTag[Foo[List[Foo[Int]]]], k=TypeRef, s=class Foo + +x=Test1$$anon$1, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1> +x=Test1$$anon$2, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1> + +()=() +true=true +a=a +1=1 +'abc='abc + +List(())=List(()) +List(true)=List(true) +List('abc)=List('abc) + +Array()=Array() +Array(true)=Array(true) +Array(a)=Array(a) +Array(1)=Array(1) + +((),())=((),()) +(true,false)=(true,false) + +List(List(1), List(2))=List(List(1), List(2)) + +Array(Array(1), Array(2))=Array(Array(1), Array(2)) + diff --git a/test/files/jvm/scala-concurrent-tck.scala b/test/files/jvm/scala-concurrent-tck.scala index fce1a25bb6..86655ad89c 100644 --- a/test/files/jvm/scala-concurrent-tck.scala +++ b/test/files/jvm/scala-concurrent-tck.scala @@ -182,6 +182,72 @@ trait FutureCombinators extends TestBase { } } + def testMapSuccessPF(): Unit = once { + done => + val f = future { 5 } + val g = f map { case r => "result: " + r } + g onSuccess { + case s => + done() + assert(s == "result: 5") + } + g onFailure { + case _ => + done() + assert(false) + } + } + + def testTransformSuccess(): Unit = once { + done => + val f = future { 5 } + val g = f.transform(r => "result: " + r, identity) + g onSuccess { + case s => + done() + assert(s == "result: 5") + } + g onFailure { + case _ => + done() + assert(false) + } + } + + def testTransformSuccessPF(): Unit = once { + done => + val f = future { 5 } + val g = f.transform( { case r => "result: " + r }, identity) + g onSuccess { + case s => + done() + assert(s == "result: 5") + } + g onFailure { + case _ => + done() + assert(false) + } + } + + def testFoldFailure(): Unit = once { + done => + val f = future { + throw new Exception("exception message") + } + val g = f.transform(r => "result: " + r, identity) + g onSuccess { + case _ => + done() + assert(false) + } + g onFailure { + case t => + done() + assert(t.getMessage() == "exception message") + } + } + def testFlatMapSuccess(): Unit = once { done => val f = future { 5 } @@ -340,14 +406,17 @@ trait FutureCombinators extends TestBase { } recover { case re: RuntimeException => "recovered" - } onSuccess { + } + f onSuccess { case x => done() assert(x == "recovered") - } onFailure { case any => + } + f onFailure { case any => done() assert(false) } + f } def testRecoverFailure(): Unit = once { @@ -357,11 +426,13 @@ trait FutureCombinators extends TestBase { throw cause } recover { case te: TimeoutException => "timeout" - } onSuccess { + } + f onSuccess { case x => done() assert(false) - } onFailure { case any => + } + f onFailure { case any => done() assert(any == cause) } @@ -375,11 +446,13 @@ trait FutureCombinators extends TestBase { } recoverWith { case re: RuntimeException => future { "recovered" } - } onSuccess { + } + f onSuccess { case x => done() assert(x == "recovered") - } onFailure { case any => + } + f onFailure { case any => done() assert(false) } @@ -393,11 +466,13 @@ trait FutureCombinators extends TestBase { } recoverWith { case te: TimeoutException => future { "timeout" } - } onSuccess { + } + f onSuccess { case x => done() assert(false) - } onFailure { case any => + } + f onFailure { case any => done() assert(any == cause) } @@ -635,11 +710,12 @@ trait Promises extends TestBase { val p = promise[Int]() val f = p.future - f.onSuccess { + f onSuccess { case x => done() assert(x == 5) - } onFailure { + } + f onFailure { case any => done() assert(false) diff --git a/test/files/jvm/signum.scala b/test/files/jvm/signum.scala index feb28d3e43..76602a6641 100644 --- a/test/files/jvm/signum.scala +++ b/test/files/jvm/signum.scala @@ -11,5 +11,11 @@ object Test { assert(math.signum(0) == 0) assert(math.signum(-1) == -1) assert(math.signum(Int.MinValue) == -1) + + assert(java.lang.Float.floatToIntBits(math.signum(0f)) == 0x0) + assert(java.lang.Float.floatToIntBits(math.signum(-0f)) == 0x80000000) + + assert(java.lang.Double.doubleToLongBits(math.signum(0d)) == 0x0L) + assert(java.lang.Double.doubleToLongBits(math.signum(-0d)) == 0x8000000000000000L) } } diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check index 01bbe2de4e..2809350855 100644 --- a/test/files/neg/names-defaults-neg.check +++ b/test/files/neg/names-defaults-neg.check @@ -28,10 +28,10 @@ names-defaults-neg.scala:18: error: not found: value m names-defaults-neg.scala:19: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. test8(x = 1) ^ -names-defaults-neg.scala:22: error: parameter specified twice: a +names-defaults-neg.scala:22: error: parameter 'a' is already specified at parameter position 1 test1(1, a = 2) ^ -names-defaults-neg.scala:23: error: parameter specified twice: b +names-defaults-neg.scala:23: error: parameter 'b' is already specified at parameter position 1 test1(b = 1, b = "2") ^ names-defaults-neg.scala:26: error: Int does not take parameters @@ -61,10 +61,10 @@ and method g in object t7 of type (a: C, b: Int*)String match argument types (C) t7.g(new C()) // ambigous reference ^ -names-defaults-neg.scala:53: error: parameter specified twice: b +names-defaults-neg.scala:53: error: parameter 'b' is already specified at parameter position 2 test5(a = 1, b = "dkjl", b = "dkj") ^ -names-defaults-neg.scala:54: error: parameter specified twice: b +names-defaults-neg.scala:54: error: parameter 'b' is already specified at parameter position 2 test5(1, "2", b = 3) ^ names-defaults-neg.scala:55: error: when using named arguments, the vararg parameter has to be specified exactly once @@ -110,7 +110,7 @@ names-defaults-neg.scala:91: error: deprecated parameter name a has to be distin names-defaults-neg.scala:93: warning: the parameter name y has been deprecated. Use b instead. deprNam3(y = 10, b = 2) ^ -names-defaults-neg.scala:93: error: parameter specified twice: b +names-defaults-neg.scala:93: error: parameter 'b' is already specified at parameter position 1 deprNam3(y = 10, b = 2) ^ names-defaults-neg.scala:98: error: unknown parameter name: m @@ -122,7 +122,7 @@ names-defaults-neg.scala:131: error: reference to var2 is ambiguous; it is both names-defaults-neg.scala:134: error: missing parameter type for expanded function ((x$1) => a = x$1) val taf2: Int => Unit = testAnnFun(a = _, b = get("+")) ^ -names-defaults-neg.scala:135: error: parameter specified twice: a +names-defaults-neg.scala:135: error: parameter 'a' is already specified at parameter position 1 val taf3 = testAnnFun(b = _: String, a = get(8)) ^ names-defaults-neg.scala:136: error: wrong number of parameters; expected = 2 @@ -149,8 +149,12 @@ names-defaults-neg.scala:170: error: reference to x is ambiguous; it is both a m names-defaults-neg.scala:177: error: variable definition needs type because 'x' is used as a named argument in its body. class u15 { var x = u.f(x = 1) } ^ +names-defaults-neg.scala:177: warning: type-checking the invocation of method f checks if the named argument expression 'x = ...' is a valid assignment +in the current scope. The resulting type inference error (see above) can be fixed by providing an explicit type in the local definition for x. + class u15 { var x = u.f(x = 1) } + ^ names-defaults-neg.scala:180: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. class u18 { var x: Int = u.f(x = 1) } ^ -one warning found +two warnings found 41 errors found diff --git a/test/files/neg/t2405.check b/test/files/neg/t2405.check new file mode 100644 index 0000000000..78360bcc21 --- /dev/null +++ b/test/files/neg/t2405.check @@ -0,0 +1,8 @@ +t2405.scala:6: warning: imported `y' is permanently hidden by definition of method y + import A.{x => y} + ^ +t2405.scala:8: error: could not find implicit value for parameter e: Int + implicitly[Int] + ^ +one warning found +one error found diff --git a/test/files/neg/t2405.scala b/test/files/neg/t2405.scala new file mode 100644 index 0000000000..6982285b98 --- /dev/null +++ b/test/files/neg/t2405.scala @@ -0,0 +1,10 @@ +object A { implicit val x: Int = 1 } + +// Expecting shadowing #1 +object Test2 { + { + import A.{x => y} + def y: Int = 0 + implicitly[Int] + } +} diff --git a/test/files/neg/t2488.check b/test/files/neg/t2488.check new file mode 100644 index 0000000000..170dbf88ff --- /dev/null +++ b/test/files/neg/t2488.check @@ -0,0 +1,31 @@ +t2488.scala:7: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (b: Int, Int) + println(c.f(b = 2, 2)) + ^ +t2488.scala:8: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (a: Int, c: Int) + println(c.f(a = 2, c = 2)) + ^ +t2488.scala:9: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (Int, c: Int) + println(c.f(2, c = 2)) + ^ +t2488.scala:10: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (c: Int, Int) + println(c.f(c = 2, 2)) + ^ +t2488.scala:11: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (Int) + println(c.f(2)) + ^ +5 errors found diff --git a/test/files/neg/t2488.scala b/test/files/neg/t2488.scala new file mode 100644 index 0000000000..8db052eec1 --- /dev/null +++ b/test/files/neg/t2488.scala @@ -0,0 +1,12 @@ +class C { + def f(a:Int, b:Int) = 1 + def f() = 2 +} +object Test extends App { + val c = new C() + println(c.f(b = 2, 2)) + println(c.f(a = 2, c = 2)) + println(c.f(2, c = 2)) + println(c.f(c = 2, 2)) + println(c.f(2)) +} diff --git a/test/files/neg/t2775.check b/test/files/neg/t2775.check index f357221cd9..a1e950cf73 100644 --- a/test/files/neg/t2775.check +++ b/test/files/neg/t2775.check @@ -1,4 +1,4 @@ -t2775.scala:1: error: cannot find class tag for element type B.this.T
-trait B[S] { type T = S; val c = new Array[T](1) }
- ^
-one error found
+t2775.scala:1: error: cannot find array tag for element type B.this.T +trait B[S] { type T = S; val c = new Array[T](1) } + ^ +one error found diff --git a/test/files/neg/t4098.check b/test/files/neg/t4098.check new file mode 100644 index 0000000000..7d69cf151c --- /dev/null +++ b/test/files/neg/t4098.check @@ -0,0 +1,13 @@ +t4098.scala:3: error: forward reference not allowed from self constructor invocation + this(b) + ^ +t4098.scala:8: error: forward reference not allowed from self constructor invocation + this(b) + ^ +t4098.scala:13: error: forward reference not allowed from self constructor invocation + this(b) + ^ +t4098.scala:18: error: forward reference not allowed from self constructor invocation + this(b) + ^ +four errors found diff --git a/test/files/neg/t4098.scala b/test/files/neg/t4098.scala new file mode 100644 index 0000000000..744d6191b5 --- /dev/null +++ b/test/files/neg/t4098.scala @@ -0,0 +1,22 @@ +class A(a: Any) { + def this() = { + this(b) + def b = new {} + } + + def this(x: Int) = { + this(b) + lazy val b = new {} + } + + def this(x: Int, y: Int) = { + this(b) + val b = new {} + } + + def this(x: Int, y: Int, z: Int) = { + this(b) + println(".") + def b = new {} + } +} diff --git a/test/files/neg/t4568.check b/test/files/neg/t4568.check new file mode 100644 index 0000000000..f94d699486 --- /dev/null +++ b/test/files/neg/t4568.check @@ -0,0 +1,4 @@ +t4568.scala:8: error: recursive method isSubListOf needs result type + case h :: t => y.contains(h) && (t.isSubListOf(y.drop(y.indexOf(h) + 1))) + ^ +one error found diff --git a/test/files/neg/t4568.scala b/test/files/neg/t4568.scala new file mode 100644 index 0000000000..8067759262 --- /dev/null +++ b/test/files/neg/t4568.scala @@ -0,0 +1,13 @@ +object SubList { + implicit def sublistable[A](x: List[A]) = new SubListable(x) + + class SubListable[A](x: List[A]) { + def isSubListOf(y: List[A]) = { + x match { + case Nil => true + case h :: t => y.contains(h) && (t.isSubListOf(y.drop(y.indexOf(h) + 1))) + } + } + } + +}
\ No newline at end of file diff --git a/test/files/neg/t4928.check b/test/files/neg/t4928.check new file mode 100644 index 0000000000..06d4f22522 --- /dev/null +++ b/test/files/neg/t4928.check @@ -0,0 +1,5 @@ +t4928.scala:3: error: parameter 'a' is already specified at parameter position 1 +Note that that 'z' is not a parameter name of the invoked method. + f(z = 0, a = 1) + ^ +one error found diff --git a/test/files/neg/t4928.scala b/test/files/neg/t4928.scala new file mode 100644 index 0000000000..17a5980314 --- /dev/null +++ b/test/files/neg/t4928.scala @@ -0,0 +1,4 @@ +class C { + def f(a: Int, b: Int = 0) = 0 + f(z = 0, a = 1) +} diff --git a/test/files/neg/t5044.check b/test/files/neg/t5044.check new file mode 100644 index 0000000000..197da2a4e8 --- /dev/null +++ b/test/files/neg/t5044.check @@ -0,0 +1,9 @@ +t5044.scala:7: error: recursive value a needs type + val id = m(a) + ^ +t5044.scala:6: warning: type-checking the invocation of method foo checks if the named argument expression 'id = ...' is a valid assignment +in the current scope. The resulting type inference error (see above) can be fixed by providing an explicit type in the local definition for id. + val a = foo(id = 1) + ^ +one warning found +one error found diff --git a/test/files/neg/t5044.scala b/test/files/neg/t5044.scala new file mode 100644 index 0000000000..2663ec1bbb --- /dev/null +++ b/test/files/neg/t5044.scala @@ -0,0 +1,9 @@ +class T { + def foo[T](id: T) = 0 + def m(a: Int) = 0 + + def f { + val a = foo(id = 1) + val id = m(a) + } +} diff --git a/test/files/neg/t5544.check b/test/files/neg/t5544.check new file mode 100644 index 0000000000..d4113935a3 --- /dev/null +++ b/test/files/neg/t5544.check @@ -0,0 +1,4 @@ +Test_2.scala:2: error: value baz is not a member of object Api + Api.baz + ^ +one error found diff --git a/test/files/neg/t5544/Api_1.scala b/test/files/neg/t5544/Api_1.scala new file mode 100644 index 0000000000..77637f440a --- /dev/null +++ b/test/files/neg/t5544/Api_1.scala @@ -0,0 +1,8 @@ +import scala.annotation.StaticAnnotation + +class ann(val bar: Any) extends StaticAnnotation + +object Api { + @ann({def baz = "baz!!"}) + def foo = println("foo") +} diff --git a/test/files/neg/t5544/Test_2.scala b/test/files/neg/t5544/Test_2.scala new file mode 100644 index 0000000000..4c8c99cbc7 --- /dev/null +++ b/test/files/neg/t5544/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends App { + Api.baz +} diff --git a/test/files/neg/t5564.check b/test/files/neg/t5564.check new file mode 100644 index 0000000000..e7e13ccc9c --- /dev/null +++ b/test/files/neg/t5564.check @@ -0,0 +1,4 @@ +t5564.scala:8: error: inferred type arguments [A] do not conform to method bar's type parameter bounds [B >: A <: C] + def bar[B >: A <: C]: T = throw new Exception + ^ +one error found diff --git a/test/files/neg/t5564.scala b/test/files/neg/t5564.scala new file mode 100644 index 0000000000..663cf88726 --- /dev/null +++ b/test/files/neg/t5564.scala @@ -0,0 +1,9 @@ + + + +trait C + + +class Foo[@specialized(Int) T, A] { + def bar[B >: A <: C]: T = throw new Exception +} diff --git a/test/files/neg/t5760-pkgobj-warn.check b/test/files/neg/t5760-pkgobj-warn.check new file mode 100644 index 0000000000..a89398c3f7 --- /dev/null +++ b/test/files/neg/t5760-pkgobj-warn.check @@ -0,0 +1,4 @@ +stalepkg_2.scala:6: error: Foo is already defined as class Foo in package object stalepkg + class Foo + ^ +one error found diff --git a/test/files/neg/t5760-pkgobj-warn/stalepkg_1.scala b/test/files/neg/t5760-pkgobj-warn/stalepkg_1.scala new file mode 100644 index 0000000000..ed4b731bb0 --- /dev/null +++ b/test/files/neg/t5760-pkgobj-warn/stalepkg_1.scala @@ -0,0 +1,11 @@ + +package object stalepkg { + class Foo +} + +package stalepkg { + object Test { + def main(args: Array[String]) { + } + } +} diff --git a/test/files/neg/t5760-pkgobj-warn/stalepkg_2.scala b/test/files/neg/t5760-pkgobj-warn/stalepkg_2.scala new file mode 100644 index 0000000000..9abcdbab17 --- /dev/null +++ b/test/files/neg/t5760-pkgobj-warn/stalepkg_2.scala @@ -0,0 +1,11 @@ + +package object stalepkg { +} + +package stalepkg { + class Foo + object Test { + def main(args: Array[String]) { + } + } +} diff --git a/test/files/neg/t5801.check b/test/files/neg/t5801.check new file mode 100644 index 0000000000..abf8e6e932 --- /dev/null +++ b/test/files/neg/t5801.check @@ -0,0 +1,22 @@ +t5801.scala:1: error: object sth is not a member of package scala +import scala.sth + ^ +t5801.scala:4: error: not found: value sth + def foo(a: Int)(implicit b: sth.Sth): Unit = {} + ^ +t5801.scala:7: error: not found: value sth + def bar(x: Int)(implicit y: Int): sth.Sth = null + ^ +t5801.scala:8: error: could not find implicit value for parameter y: Int + bar(1) + ^ +t5801.scala:10: error: not found: value sth + def meh(x: Int)(implicit a: sth.Sth, b: Int): Unit = {} + ^ +t5801.scala:13: error: not found: value sth + def meh2(x: Int)(implicit b: Int, a: sth.Sth): Unit = {} + ^ +t5801.scala:14: error: could not find implicit value for parameter b: Int + meh2(1) + ^ +7 errors found diff --git a/test/files/neg/t5801.scala b/test/files/neg/t5801.scala new file mode 100644 index 0000000000..d452222ac8 --- /dev/null +++ b/test/files/neg/t5801.scala @@ -0,0 +1,16 @@ +import scala.sth + +object Test extends App { + def foo(a: Int)(implicit b: sth.Sth): Unit = {} + foo(1) + + def bar(x: Int)(implicit y: Int): sth.Sth = null + bar(1) + + def meh(x: Int)(implicit a: sth.Sth, b: Int): Unit = {} + meh(1) + + def meh2(x: Int)(implicit b: Int, a: sth.Sth): Unit = {} + meh2(1) +} + diff --git a/test/files/neg/t5803.check b/test/files/neg/t5803.check new file mode 100644 index 0000000000..6a2de2e1df --- /dev/null +++ b/test/files/neg/t5803.check @@ -0,0 +1,4 @@ +t5803.scala:3: error: could not find implicit value for parameter ev: Nothing + new Foo(): String + ^ +one error found diff --git a/test/files/neg/t5803.scala b/test/files/neg/t5803.scala new file mode 100644 index 0000000000..f818272f86 --- /dev/null +++ b/test/files/neg/t5803.scala @@ -0,0 +1,4 @@ +object Test { + class Foo()(implicit ev: Nothing) + new Foo(): String +} diff --git a/test/files/neg/t750.check b/test/files/neg/t750.check new file mode 100644 index 0000000000..c17ca334e6 --- /dev/null +++ b/test/files/neg/t750.check @@ -0,0 +1,15 @@ +Test_2.scala:4: error: type mismatch; + found : Array[Int] + required: Array[? with Object] +Note: Int >: ? with Object, but class Array is invariant in type T. +You may wish to investigate a wildcard type such as `_ >: ? with Object`. (SLS 3.2.10) + AO_1.f(a) + ^ +Test_2.scala:5: error: type mismatch; + found : Array[Int] + required: Array[Int] +Note: Int >: Int, but class Array is invariant in type T. +You may wish to investigate a wildcard type such as `_ >: Int`. (SLS 3.2.10) + AO_1.f[Int](a) + ^ +two errors found diff --git a/test/files/neg/t750/AO_1.java b/test/files/neg/t750/AO_1.java new file mode 100644 index 0000000000..4c7360ec6f --- /dev/null +++ b/test/files/neg/t750/AO_1.java @@ -0,0 +1,5 @@ +public class AO_1 { + public static <T> void f(T[] ar0) { + System.out.println(ar0); + } +}
\ No newline at end of file diff --git a/test/files/neg/t750/Test_2.scala b/test/files/neg/t750/Test_2.scala new file mode 100644 index 0000000000..80977431c5 --- /dev/null +++ b/test/files/neg/t750/Test_2.scala @@ -0,0 +1,6 @@ +// t750 +object Test extends App { + val a = Array(1, 2, 3) + AO_1.f(a) + AO_1.f[Int](a) +} diff --git a/test/files/neg/t750b.check b/test/files/neg/t750b.check new file mode 100644 index 0000000000..72a249191e --- /dev/null +++ b/test/files/neg/t750b.check @@ -0,0 +1,15 @@ +Test.scala:4: error: type mismatch; + found : Array[Int] + required: Array[? with Object] +Note: Int >: ? with Object, but class Array is invariant in type T. +You may wish to investigate a wildcard type such as `_ >: ? with Object`. (SLS 3.2.10) + AO.f(a) + ^ +Test.scala:5: error: type mismatch; + found : Array[Int] + required: Array[Int] +Note: Int >: Int, but class Array is invariant in type T. +You may wish to investigate a wildcard type such as `_ >: Int`. (SLS 3.2.10) + AO.f[Int](a) + ^ +two errors found diff --git a/test/files/neg/t750b/AO.java b/test/files/neg/t750b/AO.java new file mode 100644 index 0000000000..060baf9a3c --- /dev/null +++ b/test/files/neg/t750b/AO.java @@ -0,0 +1,5 @@ +public class AO { + public static <T> void f(T[] ar0) { + System.out.println(ar0); + } +}
\ No newline at end of file diff --git a/test/files/neg/t750b/Test.scala b/test/files/neg/t750b/Test.scala new file mode 100644 index 0000000000..5f792a7be8 --- /dev/null +++ b/test/files/neg/t750b/Test.scala @@ -0,0 +1,6 @@ +// t750 +object Test extends App { + val a = Array(1, 2, 3) + AO.f(a) + AO.f[Int](a) +} diff --git a/test/files/neg/tailrec-2.check b/test/files/neg/tailrec-2.check index a918858773..d3432a7e76 100644 --- a/test/files/neg/tailrec-2.check +++ b/test/files/neg/tailrec-2.check @@ -1,4 +1,4 @@ -tailrec-2.scala:8: error: could not optimize @tailrec annotated method f: it contains a recursive call targetting a supertype +tailrec-2.scala:8: error: could not optimize @tailrec annotated method f: it contains a recursive call targeting supertype Super[A] @annotation.tailrec final def f[B >: A](mem: List[B]): List[B] = (null: Super[A]).f(mem) ^ tailrec-2.scala:9: error: @tailrec annotated method contains no recursive calls diff --git a/test/files/pos/gen-traversable-methods.scala b/test/files/pos/gen-traversable-methods.scala new file mode 100644 index 0000000000..2604a09f11 --- /dev/null +++ b/test/files/pos/gen-traversable-methods.scala @@ -0,0 +1,20 @@ + + + +import collection._ + + + +object Test { + + def main(args: Array[String]) { + val gen: GenTraversable[Int] = List(1, 2, 3) + gen.head + gen.headOption + gen.tail + gen.last + gen.lastOption + gen.init + } + +} diff --git a/test/files/pos/noproductN.flags b/test/files/pos/noproductN.flags deleted file mode 100644 index 14b05e7354..0000000000 --- a/test/files/pos/noproductN.flags +++ /dev/null @@ -1 +0,0 @@ --Yno-productN
\ No newline at end of file diff --git a/test/files/pos/noproductN.scala b/test/files/pos/noproductN.scala deleted file mode 100644 index 856d960b7d..0000000000 --- a/test/files/pos/noproductN.scala +++ /dev/null @@ -1,2 +0,0 @@ -object Foo { type S = String } -case class Foo(x: Foo.S) { } diff --git a/test/files/pos/overloaded_extractor_and_regular_def.scala b/test/files/pos/overloaded_extractor_and_regular_def.scala new file mode 100644 index 0000000000..c8e7da5cad --- /dev/null +++ b/test/files/pos/overloaded_extractor_and_regular_def.scala @@ -0,0 +1,32 @@ +trait TreesBase { + type Tree + + type Apply <: Tree + + val Apply: ApplyExtractor + + abstract class ApplyExtractor { + def apply(x: Int): Apply + def unapply(apply: Apply): Option[Int] + } +} + +trait TreesApi extends TreesBase { + def Apply(x: String) +} + +class Universe extends TreesApi { + abstract class Tree + case class Apply(x: Int) extends Tree + object Apply extends ApplyExtractor + def Apply(x: String) = Apply(x.toInt) +} + +object Test extends App { + def foo(tapi: TreesApi) { + import tapi._ + def bar(tree: Tree) { + val Apply(x) = tree + } + } +}
\ No newline at end of file diff --git a/test/files/pos/rangepos-patmat.flags b/test/files/pos/rangepos-patmat.flags new file mode 100644 index 0000000000..281f0a10cd --- /dev/null +++ b/test/files/pos/rangepos-patmat.flags @@ -0,0 +1 @@ +-Yrangepos diff --git a/test/files/pos/rangepos-patmat.scala b/test/files/pos/rangepos-patmat.scala new file mode 100644 index 0000000000..98c842aaf8 --- /dev/null +++ b/test/files/pos/rangepos-patmat.scala @@ -0,0 +1,4 @@ +class Foo { + def test: PartialFunction[Any, String] = { case _ => "ok" } + +} diff --git a/test/files/pos/t1133.scala b/test/files/pos/t1133.scala new file mode 100644 index 0000000000..4538de5f5f --- /dev/null +++ b/test/files/pos/t1133.scala @@ -0,0 +1,32 @@ +object Match +{ + def main(args: Array[String]) = { + args(0) match { + case Extractor1(Extractor2(Extractor3("dog", "dog", "dog"), x2, x3), b, c, Extractor3("b", "b", f), e) => println(e) + case Extractor3(Extractor2(Extractor1("a", "aa", "aaa", "aa", "a"), Extractor2("a", "aa", "aaa"), e), y, z) => println(e) + case Extractor2(Extractor3("a", "a", x), Extractor3("b", "b", y), Extractor3("c", "c", z)) => println(z) + case _ => println("fail") + } + } + + object Extractor1 { + def unapply(x: Any) = x match { + case x: String => Some(x, x+x, x+x+x, x+x, x) + case _ => None + } + } + + object Extractor2 { + def unapply(x: Any) = x match { + case x: String => Some(x, x+x, x+x+x) + case _ => None + } + } + + object Extractor3 { + def unapply(x: Any) = x match { + case x: String => Some(x, x, x) + case _ => None + } + } +} diff --git a/test/files/pos/t1987.scala b/test/files/pos/t1987a.scala index ccab133716..ccab133716 100644 --- a/test/files/pos/t1987.scala +++ b/test/files/pos/t1987a.scala diff --git a/test/files/pos/t2405.scala b/test/files/pos/t2405.scala new file mode 100644 index 0000000000..224b2ce83b --- /dev/null +++ b/test/files/pos/t2405.scala @@ -0,0 +1,23 @@ +object A { implicit val x: Int = 1 } + +// Problem as stated in the ticket. +object Test1 { + import A.{x => y} + implicitly[Int] +} + +// Testing for the absense of shadowing #1. +object Test2 { + import A.{x => y} + val x = 2 + implicitly[Int] +} + +// Testing for the absense of shadowing #2. +object Test3 { + { + import A.{x => y} + def x: Int = 0 + implicitly[Int] + } +} diff --git a/test/files/pos/t2435.scala b/test/files/pos/t2435.scala new file mode 100644 index 0000000000..2db931b99f --- /dev/null +++ b/test/files/pos/t2435.scala @@ -0,0 +1,27 @@ +object Bug { + abstract class FChain { + type T + + def chain(constant:String) = + new FConstant[this.type](constant, this) //removing [this.type], everything compiles + } + + case class FConstant[E <: FChain](constant:String, tail:E) extends FChain { + type T = tail.T + } + + object FNil extends FChain { + type T = Unit + } + +} + +object Test { + import Bug._ + println("Compiles:") + val a1 = FNil.chain("a").chain("a") + val a2 = a1.chain("a") + + println("\nDoesn't compile:") + val a = FNil.chain("a").chain("a").chain("a") +} diff --git a/test/files/pos/t2764/Ann.java b/test/files/pos/t2764/Ann.java new file mode 100644 index 0000000000..184fc6e864 --- /dev/null +++ b/test/files/pos/t2764/Ann.java @@ -0,0 +1,5 @@ +package bippy; + +public @interface Ann { + Enum value(); +} diff --git a/test/files/pos/t2764/Enum.java b/test/files/pos/t2764/Enum.java new file mode 100644 index 0000000000..fe07559535 --- /dev/null +++ b/test/files/pos/t2764/Enum.java @@ -0,0 +1,5 @@ +package bippy; + +public enum Enum { + VALUE; +} diff --git a/test/files/pos/t2764/Use.scala b/test/files/pos/t2764/Use.scala new file mode 100644 index 0000000000..8cf8102709 --- /dev/null +++ b/test/files/pos/t2764/Use.scala @@ -0,0 +1,6 @@ +package bippy + +class Use { + @Ann(Enum.VALUE) + def foo {} +} diff --git a/test/files/pos/t3880.scala b/test/files/pos/t3880.scala new file mode 100644 index 0000000000..b6f06c43a3 --- /dev/null +++ b/test/files/pos/t3880.scala @@ -0,0 +1,16 @@ +abstract class Bar[+B] { +} +abstract class C1[+B] extends Bar[B] { + private[this] def g(x: C1[B]): Unit = () + + // this method is fine: notice that it allows the call to g, + // which requires C1[B], even though we matched on C1[_]. + // (That is good news.) + private[this] def f1(x: Bar[B]): Unit = x match { + case x: C1[_] => g(x) + } + // this one crashes. + private[this] def f2(x: Bar[B]): Unit = x match { + case x: C1[_] => f2(x) + } +}
\ No newline at end of file diff --git a/test/files/pos/t4651.scala b/test/files/pos/t4651.scala new file mode 100644 index 0000000000..0612a8fcfb --- /dev/null +++ b/test/files/pos/t4651.scala @@ -0,0 +1,12 @@ +object Test { + def analyze(x: Any) = x match { + case s: String => println("It's a string: " + s) + case 1 => println("It's a one") + case (a: Int, b) => println("It's a pair of and int " + a + + " and something " + b) + case 1 :: 2 :: _ => println("It's a list starting with 1, 2") + case List(a, b, c) => println("It's a three-element list with " + + a + ", " + b + ", " + c) + case _ => println("It's something different") + } +} diff --git a/test/files/pos/t4717.scala b/test/files/pos/t4717.scala new file mode 100644 index 0000000000..4acfe489cc --- /dev/null +++ b/test/files/pos/t4717.scala @@ -0,0 +1,35 @@ + + + + + + + +trait Bug1[@specialized(Boolean) A] extends TraversableOnce[A] { + + def ++[B >: A](that: TraversableOnce[B]): Iterator[B] = new Iterator[B] { + lazy val it = that.toIterator + def hasNext = it.hasNext + def next = it.next + } + +} + + + +trait WorksFine[@specialized(Boolean) A] { + class SubBounds[B >: A] extends Bounds[B] { + lazy val it = ??? + } + def x[B >: A]: Unit = new SubBounds[B] +} + + +trait Bounds[@specialized(Boolean) A] { + // okay without `>: A` + def x[B >: A]: Unit = new Bounds[B] { + lazy val it = ??? // def or val okay + } +} + + diff --git a/test/files/pos/t4812.scala b/test/files/pos/t4812.scala new file mode 100644 index 0000000000..2a807ab05e --- /dev/null +++ b/test/files/pos/t4812.scala @@ -0,0 +1,4 @@ +trait Test1 { + def m1(sym: Symbol = 'TestSym) + def m2(s: String = "TestString") +} diff --git a/test/files/pos/t5029.flags b/test/files/pos/t5029.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/t5029.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t5029.scala b/test/files/pos/t5029.scala new file mode 100644 index 0000000000..6f9a329b80 --- /dev/null +++ b/test/files/pos/t5029.scala @@ -0,0 +1,3 @@ +object Test { + (Vector(): Seq[_]) match { case List() => true; case Nil => false } +}
\ No newline at end of file diff --git a/test/files/pos/t5137.scala b/test/files/pos/t5137.scala new file mode 100644 index 0000000000..bb72cf378f --- /dev/null +++ b/test/files/pos/t5137.scala @@ -0,0 +1,17 @@ +object Test { + + // okay + (1 * (List[BigInt]().map(((x0) => x0 match { + case x => x + })).sum)) + + // okay + ((1: BigInt) * (List[BigInt]().map({ + case x => x + }).sum)) + + // fail + (1 * (List[BigInt]().map({ + case x => x + }).sum)) +}
\ No newline at end of file diff --git a/test/files/pos/t5165/TestAnnotation.java b/test/files/pos/t5165/TestAnnotation.java new file mode 100644 index 0000000000..90886b7537 --- /dev/null +++ b/test/files/pos/t5165/TestAnnotation.java @@ -0,0 +1,11 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +public @interface TestAnnotation { + public enum TestEnumOne { A, B } + public enum TestEnumTwo { C, D } + + public TestEnumOne one(); + public TestEnumTwo two(); + public String strVal(); +} diff --git a/test/files/pos/t5165/TestObject.scala b/test/files/pos/t5165/TestObject.scala new file mode 100644 index 0000000000..eaf244e9d0 --- /dev/null +++ b/test/files/pos/t5165/TestObject.scala @@ -0,0 +1,3 @@ + +object TestObject extends TestTrait + diff --git a/test/files/pos/t5165/TestTrait.scala b/test/files/pos/t5165/TestTrait.scala new file mode 100644 index 0000000000..b317e6c6a3 --- /dev/null +++ b/test/files/pos/t5165/TestTrait.scala @@ -0,0 +1,3 @@ + +@TestAnnotation(one=TestAnnotation.TestEnumOne.A, two=TestAnnotation.TestEnumTwo.C, strVal="something") +trait TestTrait diff --git a/test/files/pos/t5210.scala b/test/files/pos/t5210.scala new file mode 100644 index 0000000000..e85037a902 --- /dev/null +++ b/test/files/pos/t5210.scala @@ -0,0 +1,10 @@ +object WithOpTest { + trait WithOp extends Cloneable { + def f: this.type = this + def g1: this.type = f + def g2: this.type = { + val t = f + t + } + } +} diff --git a/test/files/pos/t5259.scala b/test/files/pos/t5259.scala new file mode 100644 index 0000000000..d33c4dd6a7 --- /dev/null +++ b/test/files/pos/t5259.scala @@ -0,0 +1,21 @@ +class A[T] +class B { + def m(a: A[this.type] = new A[this.type]) { } +} + +class C { + def foo(a: Int, b: Int = 0) = 0 + def foo() = 0 +} + +object Test { + def newB = new B + newB.m() + + val stableB = new B + stableB.m() + + def f { + println((new C).foo(0)) + } +} diff --git a/test/files/pos/t5384.scala b/test/files/pos/t5384.scala new file mode 100644 index 0000000000..4e297d5935 --- /dev/null +++ b/test/files/pos/t5384.scala @@ -0,0 +1,7 @@ +class A(x: String, y: Int)(implicit o: String) +class B1(implicit o: String) extends A(y = 5, x = "a") +class B2(implicit o: String) extends A("a", 5) +class B3(implicit o: String) extends A(y = 5, x = "a")(o) + +class AM[E: Manifest](val x: Unit = (), y: Unit) +class BM[E: Manifest] extends AM[E](y = ()) diff --git a/test/files/pos/t5626.scala b/test/files/pos/t5626.scala new file mode 100644 index 0000000000..c501dfbe60 --- /dev/null +++ b/test/files/pos/t5626.scala @@ -0,0 +1,12 @@ +class C { + val blob = { + new { case class Foo() } + } + val blub = { + class Inner { case class Foo() } + new Inner + } + + val foo = blob.Foo() + val bar = blub.Foo() +} diff --git a/test/files/pos/t5654.scala b/test/files/pos/t5654.scala new file mode 100644 index 0000000000..1f8d05bfed --- /dev/null +++ b/test/files/pos/t5654.scala @@ -0,0 +1,13 @@ +class T(val a: Array[_]) + +class U { + val a = Array(Array(1, 2), Array("a","b")) +} + +class T1 { val a: Array[_] = Array(1) } + +case class Bomb(a: Array[_]) +case class Bomb2(a: Array[T] forSome { type T }) +class Okay1(a: Array[_]) +case class Okay2(s: Seq[_]) + diff --git a/test/files/pos/t5720-ownerous.scala b/test/files/pos/t5720-ownerous.scala index 3a12499612..ad4d4c171d 100644 --- a/test/files/pos/t5720-ownerous.scala +++ b/test/files/pos/t5720-ownerous.scala @@ -28,10 +28,10 @@ class C { //def model = Option(M("foo")()).getOrElse(M("bar")()).copy(currentUser = "")() // the bug - def model = Option(m).getOrElse(M("bar")()).copy("baz")() + def model = Option(m).getOrElse(M("bar")()).copy("baz")("empty") // style points for this version - def modish = ((null: Option[M]) getOrElse new M()()).copy()() + def modish = ((null: Option[M]) getOrElse new M()()).copy()("empty") // various simplifications are too simple case class N(currentUser: String = "anon") diff --git a/test/files/pos/t5769.scala b/test/files/pos/t5769.scala new file mode 100644 index 0000000000..723d37bfee --- /dev/null +++ b/test/files/pos/t5769.scala @@ -0,0 +1,8 @@ +// a.scala + +class A { + type AI = Array[Int] + + def f1 = arrayTag[Array[Int]] + def f2 = arrayTag[AI] +}
\ No newline at end of file diff --git a/test/files/pos/t5777.scala b/test/files/pos/t5777.scala new file mode 100644 index 0000000000..24cea36163 --- /dev/null +++ b/test/files/pos/t5777.scala @@ -0,0 +1,45 @@ +// /scala/trac/5777/a.scala +// Wed May 9 08:44:57 PDT 2012 + +trait Ring { + trait E +} + +class Poly[C <: Ring](val ring: C) extends Ring +// This definition of Poly triggers the same failure on *both* versions +// class Poly(val ring: Ring) extends Ring + +object BigInt extends Ring + +object MyApp { + val r = new Poly(BigInt) + + implicitly[r.ring.E <:< BigInt.E] + + // fail on 2.10, works on 2.9.2 + (null.asInstanceOf[BigInt.E] : r.ring.E) + + // works on both versions + val r1 = new Poly[BigInt.type](BigInt) + (null.asInstanceOf[BigInt.E] : r1.ring.E) + + // Oddly, -Xprint:typer reports that r and r1 have the same inferred type. + // + // private[this] val r: Poly[BigInt.type] = new Poly[BigInt.type](BigInt); + // <stable> <accessor> def r: Poly[BigInt.type] = MyApp.this.r; + // (null.asInstanceOf[BigInt.E]: MyApp.r.ring.E); + // private[this] val r1: Poly[BigInt.type] = new Poly[BigInt.type](BigInt); + // <stable> <accessor> def r1: Poly[BigInt.type] = MyApp.this.r1; + // (null.asInstanceOf[BigInt.E]: MyApp.r1.ring.E) + + // diff typer-2.9.2.txt typer-2.10.txt + // ... + // --- + // > object MyApp extends scala.AnyRef { + // > def <init>(): MyApp.type = { + // > MyApp.super.<init>(); + // 30c30 + // < scala.this.Predef.implicitly[<:<[BigInt.E,MyApp.r.ring.E]](scala.this.Predef.conforms[BigInt.E]); + // --- + // > scala.this.Predef.implicitly[<:<[BigInt.E,MyApp.r.ring.E]](); +} diff --git a/test/files/pos/t5796.scala b/test/files/pos/t5796.scala new file mode 100644 index 0000000000..d05350c535 --- /dev/null +++ b/test/files/pos/t5796.scala @@ -0,0 +1,8 @@ +object Bug { + def foo() { + val v = { + lazy val s = 0 + s + } + } +} diff --git a/test/files/presentation/callcc-interpreter.check b/test/files/presentation/callcc-interpreter.check index 68ac904b18..3a08e2a2ea 100644 --- a/test/files/presentation/callcc-interpreter.check +++ b/test/files/presentation/callcc-interpreter.check @@ -58,12 +58,12 @@ retrieved 64 members [accessible: true] `type AnswercallccInterpreter.Answer` [accessible: true] `type EnvironmentcallccInterpreter.Environment` [accessible: true] `type NamecallccInterpreter.Name` +[accessible: true] `value __leftOfArrowcallccInterpreter.type` +[accessible: true] `value __resultOfEnsuringcallccInterpreter.type` +[accessible: true] `value selfAny` [accessible: true] `value term0callccInterpreter.App` [accessible: true] `value term1callccInterpreter.App` [accessible: true] `value term2callccInterpreter.Add` -[accessible: false] `value __leftOfArrowcallccInterpreter.type` -[accessible: false] `value __resultOfEnsuringcallccInterpreter.type` -[accessible: false] `value selfAny` ================================================================================ askType at CallccInterpreter.scala(14,21) diff --git a/test/files/presentation/patmat.check b/test/files/presentation/hyperlinks.check index 29fd8b8e68..85d295dd7d 100644 --- a/test/files/presentation/patmat.check +++ b/test/files/presentation/hyperlinks.check @@ -1,4 +1,14 @@ -reload: PatMatTests.scala +reload: NameDefaultTests.scala, PatMatTests.scala + +askHyperlinkPos for `someOtherInt` at (14,24) NameDefaultTests.scala +================================================================================ +[response] found askHyperlinkPos for `someOtherInt` at (12,9) NameDefaultTests.scala +================================================================================ + +askHyperlinkPos for `someString` at (14,45) NameDefaultTests.scala +================================================================================ +[response] found askHyperlinkPos for `someString` at (3,7) NameDefaultTests.scala +================================================================================ askHyperlinkPos for `CaseOne` at (12,18) PatMatTests.scala ================================================================================ diff --git a/test/files/presentation/patmat.flags b/test/files/presentation/hyperlinks.flags index dc13682c5e..dc13682c5e 100644 --- a/test/files/presentation/patmat.flags +++ b/test/files/presentation/hyperlinks.flags diff --git a/test/files/presentation/patmat/Runner.scala b/test/files/presentation/hyperlinks/Runner.scala index 3d19f2d948..3d19f2d948 100644 --- a/test/files/presentation/patmat/Runner.scala +++ b/test/files/presentation/hyperlinks/Runner.scala diff --git a/test/files/presentation/hyperlinks/src/NameDefaultTests.scala b/test/files/presentation/hyperlinks/src/NameDefaultTests.scala new file mode 100644 index 0000000000..b218040fe3 --- /dev/null +++ b/test/files/presentation/hyperlinks/src/NameDefaultTests.scala @@ -0,0 +1,16 @@ + +class NameDefaults { + val someString = "abc" + val someInt = 42 + + def foo(x: String, y: Int)(implicit logger: Int): Int = y + + implicit val l = 42 + + def bar { + println() + val someOtherInt = 10 + + foo(y = someOtherInt/*#*/, x = someString/*#*/) + } +} diff --git a/test/files/presentation/patmat/src/PatMatTests.scala b/test/files/presentation/hyperlinks/src/PatMatTests.scala index bbd0f2e7ed..bbd0f2e7ed 100644 --- a/test/files/presentation/patmat/src/PatMatTests.scala +++ b/test/files/presentation/hyperlinks/src/PatMatTests.scala diff --git a/test/files/presentation/ide-bug-1000349.check b/test/files/presentation/ide-bug-1000349.check index d643f82a25..44a3207d75 100644 --- a/test/files/presentation/ide-bug-1000349.check +++ b/test/files/presentation/ide-bug-1000349.check @@ -34,7 +34,7 @@ retrieved 37 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Foo` [accessible: true] `method →[B](y: B)(Foo, B)` -[accessible: false] `value __leftOfArrowFoo` -[accessible: false] `value __resultOfEnsuringFoo` -[accessible: false] `value selfAny` +[accessible: true] `value __leftOfArrowFoo` +[accessible: true] `value __resultOfEnsuringFoo` +[accessible: true] `value selfAny` ================================================================================ diff --git a/test/files/presentation/ide-bug-1000475.check b/test/files/presentation/ide-bug-1000475.check index 2410ebf71d..34c3b557d8 100644 --- a/test/files/presentation/ide-bug-1000475.check +++ b/test/files/presentation/ide-bug-1000475.check @@ -31,11 +31,11 @@ retrieved 36 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Object` [accessible: true] `method →[B](y: B)(Object, B)` +[accessible: true] `value __leftOfArrowObject` +[accessible: true] `value __resultOfEnsuringObject` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` -[accessible: false] `value __leftOfArrowObject` -[accessible: false] `value __resultOfEnsuringObject` -[accessible: false] `value selfAny` ================================================================================ askTypeCompletion at Foo.scala(6,10) @@ -69,11 +69,11 @@ retrieved 36 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Object` [accessible: true] `method →[B](y: B)(Object, B)` +[accessible: true] `value __leftOfArrowObject` +[accessible: true] `value __resultOfEnsuringObject` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` -[accessible: false] `value __leftOfArrowObject` -[accessible: false] `value __resultOfEnsuringObject` -[accessible: false] `value selfAny` ================================================================================ askTypeCompletion at Foo.scala(7,7) @@ -107,9 +107,9 @@ retrieved 36 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Object` [accessible: true] `method →[B](y: B)(Object, B)` +[accessible: true] `value __leftOfArrowObject` +[accessible: true] `value __resultOfEnsuringObject` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` -[accessible: false] `value __leftOfArrowObject` -[accessible: false] `value __resultOfEnsuringObject` -[accessible: false] `value selfAny` ================================================================================ diff --git a/test/files/presentation/ide-bug-1000531.check b/test/files/presentation/ide-bug-1000531.check index 2ae0158a13..dcbd440801 100644 --- a/test/files/presentation/ide-bug-1000531.check +++ b/test/files/presentation/ide-bug-1000531.check @@ -118,10 +118,10 @@ retrieved 124 members [accessible: true] `method zipWithIndex=> Iterator[(B, Int)]` [accessible: true] `method zip[B](that: Iterator[B])Iterator[(B, B)]` [accessible: true] `method →[B](y: B)(java.util.Iterator[B], B)` +[accessible: true] `value __leftOfArrowjava.util.Iterator[B]` +[accessible: true] `value __resultOfEnsuringjava.util.Iterator[B]` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` [accessible: false] `method reversed=> List[B]` -[accessible: false] `value __leftOfArrowjava.util.Iterator[B]` -[accessible: false] `value __resultOfEnsuringjava.util.Iterator[B]` -[accessible: false] `value selfAny` ================================================================================ diff --git a/test/files/presentation/implicit-member.check b/test/files/presentation/implicit-member.check index ce21293ae5..05d6f61699 100644 --- a/test/files/presentation/implicit-member.check +++ b/test/files/presentation/implicit-member.check @@ -35,8 +35,8 @@ retrieved 39 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Implicit.type` [accessible: true] `method →[B](y: B)(Implicit.type, B)` -[accessible: false] `value __leftOfArrowImplicit.type` -[accessible: false] `value __resultOfEnsuringImplicit.type` -[accessible: false] `value selfAny` -[accessible: false] `value xImplicit.type` +[accessible: true] `value __leftOfArrowImplicit.type` +[accessible: true] `value __resultOfEnsuringImplicit.type` +[accessible: true] `value selfAny` +[accessible: true] `value xImplicit.type` ================================================================================ diff --git a/test/files/presentation/ping-pong.check b/test/files/presentation/ping-pong.check index 1f02274736..b666d51de5 100644 --- a/test/files/presentation/ping-pong.check +++ b/test/files/presentation/ping-pong.check @@ -32,13 +32,13 @@ retrieved 40 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Pong` [accessible: true] `method →[B](y: B)(Pong, B)` +[accessible: true] `value __leftOfArrowPong` +[accessible: true] `value __resultOfEnsuringPong` +[accessible: true] `value nameString` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` -[accessible: false] `value __leftOfArrowPong` -[accessible: false] `value __resultOfEnsuringPong` -[accessible: false] `value nameString` [accessible: false] `value pingPing` -[accessible: false] `value selfAny` ================================================================================ askTypeCompletion at PingPong.scala(19,20) @@ -75,12 +75,12 @@ retrieved 40 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> Ping` [accessible: true] `method →[B](y: B)(Ping, B)` +[accessible: true] `value __leftOfArrowPing` +[accessible: true] `value __resultOfEnsuringPing` +[accessible: true] `value pongPong` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` -[accessible: false] `value __leftOfArrowPing` -[accessible: false] `value __resultOfEnsuringPing` -[accessible: false] `value pongPong` -[accessible: false] `value selfAny` ================================================================================ askType at PingPong.scala(8,10) diff --git a/test/files/presentation/t5708.check b/test/files/presentation/t5708.check new file mode 100644 index 0000000000..c6d4762635 --- /dev/null +++ b/test/files/presentation/t5708.check @@ -0,0 +1,47 @@ +reload: Completions.scala + +askTypeCompletion at Completions.scala(17,9) +================================================================================ +[response] aksTypeCompletion at (17,9) +retrieved 44 members +[accessible: true] `lazy value fooInt` +[accessible: true] `method !=(x$1: Any)Boolean` +[accessible: true] `method !=(x$1: AnyRef)Boolean` +[accessible: true] `method ##()Int` +[accessible: true] `method +(other: String)String` +[accessible: true] `method ->[B](y: B)(test.Compat.type, B)` +[accessible: true] `method ==(x$1: Any)Boolean` +[accessible: true] `method ==(x$1: AnyRef)Boolean` +[accessible: true] `method asInstanceOf[T0]=> T0` +[accessible: true] `method ensuring(cond: Boolean)test.Compat.type` +[accessible: true] `method ensuring(cond: Boolean, msg: => Any)test.Compat.type` +[accessible: true] `method ensuring(cond: test.Compat.type => Boolean)test.Compat.type` +[accessible: true] `method ensuring(cond: test.Compat.type => Boolean, msg: => Any)test.Compat.type` +[accessible: true] `method eq(x$1: AnyRef)Boolean` +[accessible: true] `method equals(x$1: Any)Boolean` +[accessible: true] `method formatted(fmtstr: String)String` +[accessible: true] `method hashCode()Int` +[accessible: true] `method isInstanceOf[T0]=> Boolean` +[accessible: true] `method ne(x$1: AnyRef)Boolean` +[accessible: true] `method notify()Unit` +[accessible: true] `method notifyAll()Unit` +[accessible: true] `method pkgPrivateM=> String` +[accessible: true] `method synchronized[T0](x$1: T0)T0` +[accessible: true] `method toString()String` +[accessible: true] `method wait()Unit` +[accessible: true] `method wait(x$1: Long)Unit` +[accessible: true] `method wait(x$1: Long, x$2: Int)Unit` +[accessible: true] `method x=> test.Compat.type` +[accessible: true] `method →[B](y: B)(test.Compat.type, B)` +[accessible: true] `value CONST_STRINGString("constant")` +[accessible: true] `value __leftOfArrowtest.Compat.type` +[accessible: true] `value __resultOfEnsuringtest.Compat.type` +[accessible: true] `value pkgPrivateVString` +[accessible: true] `value selfAny` +[accessible: false] `method clone()Object` +[accessible: false] `method finalize()Unit` +[accessible: false] `method privateM=> String` +[accessible: false] `method protectedValM=> String` +[accessible: false] `value privateVString` +[accessible: false] `value protectedVString` +================================================================================ diff --git a/test/files/presentation/t5708/Test.scala b/test/files/presentation/t5708/Test.scala new file mode 100644 index 0000000000..96e758d974 --- /dev/null +++ b/test/files/presentation/t5708/Test.scala @@ -0,0 +1,5 @@ +import scala.tools.nsc.interactive.tests.InteractiveTest + +object Test extends InteractiveTest { + +}
\ No newline at end of file diff --git a/test/files/presentation/t5708/src/Completions.scala b/test/files/presentation/t5708/src/Completions.scala new file mode 100644 index 0000000000..1e9e5d5eb1 --- /dev/null +++ b/test/files/presentation/t5708/src/Completions.scala @@ -0,0 +1,18 @@ +package test + +object Compat { + final val CONST_STRING = "constant" + lazy val foo = 4 + + private val privateV = "" + private[test] val pkgPrivateV = "" + protected val protectedV = "" + + private def privateM = "" + private[test] def pkgPrivateM = "" + protected def protectedValM = "" +} + +class Foo { + Compat./*!*/CONST_STRING // its 'accessible' flag is false +} diff --git a/test/files/presentation/visibility.check b/test/files/presentation/visibility.check index 290a5ac381..3026e58f7e 100644 --- a/test/files/presentation/visibility.check +++ b/test/files/presentation/visibility.check @@ -38,10 +38,10 @@ retrieved 42 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> accessibility.Foo` [accessible: true] `method →[B](y: B)(accessibility.Foo, B)` +[accessible: true] `value __leftOfArrowaccessibility.Foo` +[accessible: true] `value __resultOfEnsuringaccessibility.Foo` +[accessible: true] `value selfAny` [accessible: false] `method secretPrivateThis()Unit` -[accessible: false] `value __leftOfArrowaccessibility.Foo` -[accessible: false] `value __resultOfEnsuringaccessibility.Foo` -[accessible: false] `value selfAny` ================================================================================ askTypeCompletion at Completions.scala(16,11) @@ -83,9 +83,9 @@ retrieved 42 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> accessibility.Foo` [accessible: true] `method →[B](y: B)(accessibility.Foo, B)` -[accessible: false] `value __leftOfArrowaccessibility.Foo` -[accessible: false] `value __resultOfEnsuringaccessibility.Foo` -[accessible: false] `value selfAny` +[accessible: true] `value __leftOfArrowaccessibility.Foo` +[accessible: true] `value __resultOfEnsuringaccessibility.Foo` +[accessible: true] `value selfAny` ================================================================================ askTypeCompletion at Completions.scala(22,11) @@ -126,10 +126,10 @@ retrieved 42 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> accessibility.AccessibilityChecks` [accessible: true] `method →[B](y: B)(accessibility.AccessibilityChecks, B)` +[accessible: true] `value __leftOfArrowaccessibility.AccessibilityChecks` +[accessible: true] `value __resultOfEnsuringaccessibility.AccessibilityChecks` +[accessible: true] `value selfAny` [accessible: false] `method secretPrivate()Unit` -[accessible: false] `value __leftOfArrowaccessibility.AccessibilityChecks` -[accessible: false] `value __resultOfEnsuringaccessibility.AccessibilityChecks` -[accessible: false] `value selfAny` ================================================================================ askTypeCompletion at Completions.scala(28,10) @@ -166,14 +166,14 @@ retrieved 42 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> accessibility.Foo` [accessible: true] `method →[B](y: B)(accessibility.Foo, B)` +[accessible: true] `value __leftOfArrowaccessibility.Foo` +[accessible: true] `value __resultOfEnsuringaccessibility.Foo` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` [accessible: false] `method secretPrivate()Unit` [accessible: false] `method secretPrivateThis()Unit` [accessible: false] `method secretProtected()Unit` -[accessible: false] `value __leftOfArrowaccessibility.Foo` -[accessible: false] `value __resultOfEnsuringaccessibility.Foo` -[accessible: false] `value selfAny` ================================================================================ askTypeCompletion at Completions.scala(37,8) @@ -209,13 +209,13 @@ retrieved 42 members [accessible: true] `method wait(x$1: Long, x$2: Int)Unit` [accessible: true] `method x=> accessibility.Foo` [accessible: true] `method →[B](y: B)(accessibility.Foo, B)` +[accessible: true] `value __leftOfArrowaccessibility.Foo` +[accessible: true] `value __resultOfEnsuringaccessibility.Foo` +[accessible: true] `value selfAny` [accessible: false] `method clone()Object` [accessible: false] `method finalize()Unit` [accessible: false] `method secretPrivate()Unit` [accessible: false] `method secretPrivateThis()Unit` [accessible: false] `method secretProtected()Unit` [accessible: false] `method secretProtectedInPackage()Unit` -[accessible: false] `value __leftOfArrowaccessibility.Foo` -[accessible: false] `value __resultOfEnsuringaccessibility.Foo` -[accessible: false] `value selfAny` ================================================================================ diff --git a/test/files/run/backreferences.check b/test/files/run/backreferences.check new file mode 100644 index 0000000000..1d474d5255 --- /dev/null +++ b/test/files/run/backreferences.check @@ -0,0 +1,2 @@ +false +true diff --git a/test/files/run/backreferences.scala b/test/files/run/backreferences.scala new file mode 100644 index 0000000000..335cd6c7de --- /dev/null +++ b/test/files/run/backreferences.scala @@ -0,0 +1,13 @@ +case class Elem[T](x: T, y: T) + +object Test { + def unrolled[T](x: Any, y: Any, z: Any) = (x, y, z) match { + case (el: Elem[_], el.x, el.y) => true + case _ => false + } + + def main(args: Array[String]): Unit = { + println(unrolled(Elem("bippy", 5), "bippy", 6)) + println(unrolled(Elem("bippy", 5), "bippy", 5)) + } +} diff --git a/test/files/run/caseClassHash.check b/test/files/run/caseClassHash.check new file mode 100644 index 0000000000..b5a6f08e99 --- /dev/null +++ b/test/files/run/caseClassHash.check @@ -0,0 +1,9 @@ +Foo(true,-1,-1,d,-5,-10,500.0,500.0,List(),5.0) +Foo(true,-1,-1,d,-5,-10,500.0,500.0,List(),5) +1383698062 +1383698062 +true +## method 1: 1383698062 +## method 2: 1383698062 + Murmur 1: 1383698062 + Murmur 2: 1383698062 diff --git a/test/files/run/caseClassHash.scala b/test/files/run/caseClassHash.scala new file mode 100644 index 0000000000..7adfddedf8 --- /dev/null +++ b/test/files/run/caseClassHash.scala @@ -0,0 +1,37 @@ +case class Foo[T](a: Boolean, b: Byte, c: Short, d: Char, e: Int, f: Long, g: Double, h: Float, i: AnyRef, j: T) { } + +object Test { + def mkFoo[T](x: T) = Foo[T](true, -1, -1, 100, -5, -10, 500d, 500f, Nil, x) + + def main(args: Array[String]): Unit = { + val foo1 = mkFoo[Double](5.0d) + val foo2 = mkFoo[Long](5l) + + List(foo1, foo2, foo1.##, foo2.##, foo1 == foo2) foreach println + + println("## method 1: " + foo1.##) + println("## method 2: " + foo2.##) + println(" Murmur 1: " + scala.util.MurmurHash3.productHash(foo1)) + println(" Murmur 2: " + scala.util.MurmurHash3.productHash(foo2)) + } +} + +object Timing { + var hash = 0 + def mkFoo(i: Int) = Foo(i % 2 == 0, i.toByte, i.toShort, i.toChar, i, i, 1.1, 1.1f, this, this) + + def main(args: Array[String]): Unit = { + val reps = if (args.isEmpty) 100000000 else args(0).toInt + val start = System.nanoTime + + println("Warmup.") + 1 to 10000 foreach mkFoo + + hash = 0 + 1 to reps foreach (i => hash += mkFoo(i).##) + + val end = System.nanoTime + println("hash = " + hash) + println("Elapsed: " + ((end - start) / 1e6) + " ms.") + } +} diff --git a/test/files/run/color.check b/test/files/run/color.check deleted file mode 100644 index 598cc145f0..0000000000 --- a/test/files/run/color.check +++ /dev/null @@ -1,693 +0,0 @@ - -1 color -[30mthe quick brown fox[0m Black -[31mthe quick brown fox[0m Red -[32mthe quick brown fox[0m Green -[33mthe quick brown fox[0m Yellow -[34mthe quick brown fox[0m Blue -[35mthe quick brown fox[0m Magenta -[36mthe quick brown fox[0m Cyan -[37mthe quick brown fox[0m White - -1 effect -[0mthe quick brown fox[0m Reset -[1mthe quick brown fox[0m Bright -[2mthe quick brown fox[0m Faint -[3mthe quick brown fox[0m Italic -[4mthe quick brown fox[0m Underline -[5mthe quick brown fox[0m Blink -[7mthe quick brown fox[0m Inverse -[8mthe quick brown fox[0m Hidden -[9mthe quick brown fox[0m Strikethrough - -1 color 1 effect -[1;30mthe quick brown fox[0m Bright Black -[4;30mthe quick brown fox[0m Underline Black -[7;30mthe quick brown fox[0m Inverse Black -[1;31mthe quick brown fox[0m Bright Red -[4;31mthe quick brown fox[0m Underline Red -[7;31mthe quick brown fox[0m Inverse Red -[1;32mthe quick brown fox[0m Bright Green -[4;32mthe quick brown fox[0m Underline Green -[7;32mthe quick brown fox[0m Inverse Green -[1;33mthe quick brown fox[0m Bright Yellow -[4;33mthe quick brown fox[0m Underline Yellow -[7;33mthe quick brown fox[0m Inverse Yellow -[1;34mthe quick brown fox[0m Bright Blue -[4;34mthe quick brown fox[0m Underline Blue -[7;34mthe quick brown fox[0m Inverse Blue -[1;35mthe quick brown fox[0m Bright Magenta -[4;35mthe quick brown fox[0m Underline Magenta -[7;35mthe quick brown fox[0m Inverse Magenta -[1;36mthe quick brown fox[0m Bright Cyan -[4;36mthe quick brown fox[0m Underline Cyan -[7;36mthe quick brown fox[0m Inverse Cyan -[1;37mthe quick brown fox[0m Bright White -[4;37mthe quick brown fox[0m Underline White -[7;37mthe quick brown fox[0m Inverse White - -2 colors 0 effects -[30;40mthe quick brown fox[0m Black (on Black background) -[31;40mthe quick brown fox[0m Red (on Black background) -[32;40mthe quick brown fox[0m Green (on Black background) -[33;40mthe quick brown fox[0m Yellow (on Black background) -[34;40mthe quick brown fox[0m Blue (on Black background) -[35;40mthe quick brown fox[0m Magenta (on Black background) -[36;40mthe quick brown fox[0m Cyan (on Black background) -[37;40mthe quick brown fox[0m White (on Black background) -[30;41mthe quick brown fox[0m Black (on Red background) -[31;41mthe quick brown fox[0m Red (on Red background) -[32;41mthe quick brown fox[0m Green (on Red background) -[33;41mthe quick brown fox[0m Yellow (on Red background) -[34;41mthe quick brown fox[0m Blue (on Red background) -[35;41mthe quick brown fox[0m Magenta (on Red background) -[36;41mthe quick brown fox[0m Cyan (on Red background) -[37;41mthe quick brown fox[0m White (on Red background) -[30;42mthe quick brown fox[0m Black (on Green background) -[31;42mthe quick brown fox[0m Red (on Green background) -[32;42mthe quick brown fox[0m Green (on Green background) -[33;42mthe quick brown fox[0m Yellow (on Green background) -[34;42mthe quick brown fox[0m Blue (on Green background) -[35;42mthe quick brown fox[0m Magenta (on Green background) -[36;42mthe quick brown fox[0m Cyan (on Green background) -[37;42mthe quick brown fox[0m White (on Green background) -[30;43mthe quick brown fox[0m Black (on Yellow background) -[31;43mthe quick brown fox[0m Red (on Yellow background) -[32;43mthe quick brown fox[0m Green (on Yellow background) -[33;43mthe quick brown fox[0m Yellow (on Yellow background) -[34;43mthe quick brown fox[0m Blue (on Yellow background) -[35;43mthe quick brown fox[0m Magenta (on Yellow background) -[36;43mthe quick brown fox[0m Cyan (on Yellow background) -[37;43mthe quick brown fox[0m White (on Yellow background) -[30;44mthe quick brown fox[0m Black (on Blue background) -[31;44mthe quick brown fox[0m Red (on Blue background) -[32;44mthe quick brown fox[0m Green (on Blue background) -[33;44mthe quick brown fox[0m Yellow (on Blue background) -[34;44mthe quick brown fox[0m Blue (on Blue background) -[35;44mthe quick brown fox[0m Magenta (on Blue background) -[36;44mthe quick brown fox[0m Cyan (on Blue background) -[37;44mthe quick brown fox[0m White (on Blue background) -[30;45mthe quick brown fox[0m Black (on Magenta background) -[31;45mthe quick brown fox[0m Red (on Magenta background) -[32;45mthe quick brown fox[0m Green (on Magenta background) -[33;45mthe quick brown fox[0m Yellow (on Magenta background) -[34;45mthe quick brown fox[0m Blue (on Magenta background) -[35;45mthe quick brown fox[0m Magenta (on Magenta background) -[36;45mthe quick brown fox[0m Cyan (on Magenta background) -[37;45mthe quick brown fox[0m White (on Magenta background) -[30;46mthe quick brown fox[0m Black (on Cyan background) -[31;46mthe quick brown fox[0m Red (on Cyan background) -[32;46mthe quick brown fox[0m Green (on Cyan background) -[33;46mthe quick brown fox[0m Yellow (on Cyan background) -[34;46mthe quick brown fox[0m Blue (on Cyan background) -[35;46mthe quick brown fox[0m Magenta (on Cyan background) -[36;46mthe quick brown fox[0m Cyan (on Cyan background) -[37;46mthe quick brown fox[0m White (on Cyan background) -[30;47mthe quick brown fox[0m Black (on White background) -[31;47mthe quick brown fox[0m Red (on White background) -[32;47mthe quick brown fox[0m Green (on White background) -[33;47mthe quick brown fox[0m Yellow (on White background) -[34;47mthe quick brown fox[0m Blue (on White background) -[35;47mthe quick brown fox[0m Magenta (on White background) -[36;47mthe quick brown fox[0m Cyan (on White background) -[37;47mthe quick brown fox[0m White (on White background) - -2 colors 1 effect -[1;30;40mthe quick brown fox[0m Bright Black (on Black background) -[4;30;40mthe quick brown fox[0m Underline Black (on Black background) -[7;30;40mthe quick brown fox[0m Inverse Black (on Black background) -[1;31;40mthe quick brown fox[0m Bright Red (on Black background) -[4;31;40mthe quick brown fox[0m Underline Red (on Black background) -[7;31;40mthe quick brown fox[0m Inverse Red (on Black background) -[1;32;40mthe quick brown fox[0m Bright Green (on Black background) -[4;32;40mthe quick brown fox[0m Underline Green (on Black background) -[7;32;40mthe quick brown fox[0m Inverse Green (on Black background) -[1;33;40mthe quick brown fox[0m Bright Yellow (on Black background) -[4;33;40mthe quick brown fox[0m Underline Yellow (on Black background) -[7;33;40mthe quick brown fox[0m Inverse Yellow (on Black background) -[1;34;40mthe quick brown fox[0m Bright Blue (on Black background) -[4;34;40mthe quick brown fox[0m Underline Blue (on Black background) -[7;34;40mthe quick brown fox[0m Inverse Blue (on Black background) -[1;35;40mthe quick brown fox[0m Bright Magenta (on Black background) -[4;35;40mthe quick brown fox[0m Underline Magenta (on Black background) -[7;35;40mthe quick brown fox[0m Inverse Magenta (on Black background) -[1;36;40mthe quick brown fox[0m Bright Cyan (on Black background) -[4;36;40mthe quick brown fox[0m Underline Cyan (on Black background) -[7;36;40mthe quick brown fox[0m Inverse Cyan (on Black background) -[1;37;40mthe quick brown fox[0m Bright White (on Black background) -[4;37;40mthe quick brown fox[0m Underline White (on Black background) -[7;37;40mthe quick brown fox[0m Inverse White (on Black background) -[1;30;41mthe quick brown fox[0m Bright Black (on Red background) -[4;30;41mthe quick brown fox[0m Underline Black (on Red background) -[7;30;41mthe quick brown fox[0m Inverse Black (on Red background) -[1;31;41mthe quick brown fox[0m Bright Red (on Red background) -[4;31;41mthe quick brown fox[0m Underline Red (on Red background) -[7;31;41mthe quick brown fox[0m Inverse Red (on Red background) -[1;32;41mthe quick brown fox[0m Bright Green (on Red background) -[4;32;41mthe quick brown fox[0m Underline Green (on Red background) -[7;32;41mthe quick brown fox[0m Inverse Green (on Red background) -[1;33;41mthe quick brown fox[0m Bright Yellow (on Red background) -[4;33;41mthe quick brown fox[0m Underline Yellow (on Red background) -[7;33;41mthe quick brown fox[0m Inverse Yellow (on Red background) -[1;34;41mthe quick brown fox[0m Bright Blue (on Red background) -[4;34;41mthe quick brown fox[0m Underline Blue (on Red background) -[7;34;41mthe quick brown fox[0m Inverse Blue (on Red background) -[1;35;41mthe quick brown fox[0m Bright Magenta (on Red background) -[4;35;41mthe quick brown fox[0m Underline Magenta (on Red background) -[7;35;41mthe quick brown fox[0m Inverse Magenta (on Red background) -[1;36;41mthe quick brown fox[0m Bright Cyan (on Red background) -[4;36;41mthe quick brown fox[0m Underline Cyan (on Red background) -[7;36;41mthe quick brown fox[0m Inverse Cyan (on Red background) -[1;37;41mthe quick brown fox[0m Bright White (on Red background) -[4;37;41mthe quick brown fox[0m Underline White (on Red background) -[7;37;41mthe quick brown fox[0m Inverse White (on Red background) -[1;30;42mthe quick brown fox[0m Bright Black (on Green background) -[4;30;42mthe quick brown fox[0m Underline Black (on Green background) -[7;30;42mthe quick brown fox[0m Inverse Black (on Green background) -[1;31;42mthe quick brown fox[0m Bright Red (on Green background) -[4;31;42mthe quick brown fox[0m Underline Red (on Green background) -[7;31;42mthe quick brown fox[0m Inverse Red (on Green background) -[1;32;42mthe quick brown fox[0m Bright Green (on Green background) -[4;32;42mthe quick brown fox[0m Underline Green (on Green background) -[7;32;42mthe quick brown fox[0m Inverse Green (on Green background) -[1;33;42mthe quick brown fox[0m Bright Yellow (on Green background) -[4;33;42mthe quick brown fox[0m Underline Yellow (on Green background) -[7;33;42mthe quick brown fox[0m Inverse Yellow (on Green background) -[1;34;42mthe quick brown fox[0m Bright Blue (on Green background) -[4;34;42mthe quick brown fox[0m Underline Blue (on Green background) -[7;34;42mthe quick brown fox[0m Inverse Blue (on Green background) -[1;35;42mthe quick brown fox[0m Bright Magenta (on Green background) -[4;35;42mthe quick brown fox[0m Underline Magenta (on Green background) -[7;35;42mthe quick brown fox[0m Inverse Magenta (on Green background) -[1;36;42mthe quick brown fox[0m Bright Cyan (on Green background) -[4;36;42mthe quick brown fox[0m Underline Cyan (on Green background) -[7;36;42mthe quick brown fox[0m Inverse Cyan (on Green background) -[1;37;42mthe quick brown fox[0m Bright White (on Green background) -[4;37;42mthe quick brown fox[0m Underline White (on Green background) -[7;37;42mthe quick brown fox[0m Inverse White (on Green background) -[1;30;43mthe quick brown fox[0m Bright Black (on Yellow background) -[4;30;43mthe quick brown fox[0m Underline Black (on Yellow background) -[7;30;43mthe quick brown fox[0m Inverse Black (on Yellow background) -[1;31;43mthe quick brown fox[0m Bright Red (on Yellow background) -[4;31;43mthe quick brown fox[0m Underline Red (on Yellow background) -[7;31;43mthe quick brown fox[0m Inverse Red (on Yellow background) -[1;32;43mthe quick brown fox[0m Bright Green (on Yellow background) -[4;32;43mthe quick brown fox[0m Underline Green (on Yellow background) -[7;32;43mthe quick brown fox[0m Inverse Green (on Yellow background) -[1;33;43mthe quick brown fox[0m Bright Yellow (on Yellow background) -[4;33;43mthe quick brown fox[0m Underline Yellow (on Yellow background) -[7;33;43mthe quick brown fox[0m Inverse Yellow (on Yellow background) -[1;34;43mthe quick brown fox[0m Bright Blue (on Yellow background) -[4;34;43mthe quick brown fox[0m Underline Blue (on Yellow background) -[7;34;43mthe quick brown fox[0m Inverse Blue (on Yellow background) -[1;35;43mthe quick brown fox[0m Bright Magenta (on Yellow background) -[4;35;43mthe quick brown fox[0m Underline Magenta (on Yellow background) -[7;35;43mthe quick brown fox[0m Inverse Magenta (on Yellow background) -[1;36;43mthe quick brown fox[0m Bright Cyan (on Yellow background) -[4;36;43mthe quick brown fox[0m Underline Cyan (on Yellow background) -[7;36;43mthe quick brown fox[0m Inverse Cyan (on Yellow background) -[1;37;43mthe quick brown fox[0m Bright White (on Yellow background) -[4;37;43mthe quick brown fox[0m Underline White (on Yellow background) -[7;37;43mthe quick brown fox[0m Inverse White (on Yellow background) -[1;30;44mthe quick brown fox[0m Bright Black (on Blue background) -[4;30;44mthe quick brown fox[0m Underline Black (on Blue background) -[7;30;44mthe quick brown fox[0m Inverse Black (on Blue background) -[1;31;44mthe quick brown fox[0m Bright Red (on Blue background) -[4;31;44mthe quick brown fox[0m Underline Red (on Blue background) -[7;31;44mthe quick brown fox[0m Inverse Red (on Blue background) -[1;32;44mthe quick brown fox[0m Bright Green (on Blue background) -[4;32;44mthe quick brown fox[0m Underline Green (on Blue background) -[7;32;44mthe quick brown fox[0m Inverse Green (on Blue background) -[1;33;44mthe quick brown fox[0m Bright Yellow (on Blue background) -[4;33;44mthe quick brown fox[0m Underline Yellow (on Blue background) -[7;33;44mthe quick brown fox[0m Inverse Yellow (on Blue background) -[1;34;44mthe quick brown fox[0m Bright Blue (on Blue background) -[4;34;44mthe quick brown fox[0m Underline Blue (on Blue background) -[7;34;44mthe quick brown fox[0m Inverse Blue (on Blue background) -[1;35;44mthe quick brown fox[0m Bright Magenta (on Blue background) -[4;35;44mthe quick brown fox[0m Underline Magenta (on Blue background) -[7;35;44mthe quick brown fox[0m Inverse Magenta (on Blue background) -[1;36;44mthe quick brown fox[0m Bright Cyan (on Blue background) -[4;36;44mthe quick brown fox[0m Underline Cyan (on Blue background) -[7;36;44mthe quick brown fox[0m Inverse Cyan (on Blue background) -[1;37;44mthe quick brown fox[0m Bright White (on Blue background) -[4;37;44mthe quick brown fox[0m Underline White (on Blue background) -[7;37;44mthe quick brown fox[0m Inverse White (on Blue background) -[1;30;45mthe quick brown fox[0m Bright Black (on Magenta background) -[4;30;45mthe quick brown fox[0m Underline Black (on Magenta background) -[7;30;45mthe quick brown fox[0m Inverse Black (on Magenta background) -[1;31;45mthe quick brown fox[0m Bright Red (on Magenta background) -[4;31;45mthe quick brown fox[0m Underline Red (on Magenta background) -[7;31;45mthe quick brown fox[0m Inverse Red (on Magenta background) -[1;32;45mthe quick brown fox[0m Bright Green (on Magenta background) -[4;32;45mthe quick brown fox[0m Underline Green (on Magenta background) -[7;32;45mthe quick brown fox[0m Inverse Green (on Magenta background) -[1;33;45mthe quick brown fox[0m Bright Yellow (on Magenta background) -[4;33;45mthe quick brown fox[0m Underline Yellow (on Magenta background) -[7;33;45mthe quick brown fox[0m Inverse Yellow (on Magenta background) -[1;34;45mthe quick brown fox[0m Bright Blue (on Magenta background) -[4;34;45mthe quick brown fox[0m Underline Blue (on Magenta background) -[7;34;45mthe quick brown fox[0m Inverse Blue (on Magenta background) -[1;35;45mthe quick brown fox[0m Bright Magenta (on Magenta background) -[4;35;45mthe quick brown fox[0m Underline Magenta (on Magenta background) -[7;35;45mthe quick brown fox[0m Inverse Magenta (on Magenta background) -[1;36;45mthe quick brown fox[0m Bright Cyan (on Magenta background) -[4;36;45mthe quick brown fox[0m Underline Cyan (on Magenta background) -[7;36;45mthe quick brown fox[0m Inverse Cyan (on Magenta background) -[1;37;45mthe quick brown fox[0m Bright White (on Magenta background) -[4;37;45mthe quick brown fox[0m Underline White (on Magenta background) -[7;37;45mthe quick brown fox[0m Inverse White (on Magenta background) -[1;30;46mthe quick brown fox[0m Bright Black (on Cyan background) -[4;30;46mthe quick brown fox[0m Underline Black (on Cyan background) -[7;30;46mthe quick brown fox[0m Inverse Black (on Cyan background) -[1;31;46mthe quick brown fox[0m Bright Red (on Cyan background) -[4;31;46mthe quick brown fox[0m Underline Red (on Cyan background) -[7;31;46mthe quick brown fox[0m Inverse Red (on Cyan background) -[1;32;46mthe quick brown fox[0m Bright Green (on Cyan background) -[4;32;46mthe quick brown fox[0m Underline Green (on Cyan background) -[7;32;46mthe quick brown fox[0m Inverse Green (on Cyan background) -[1;33;46mthe quick brown fox[0m Bright Yellow (on Cyan background) -[4;33;46mthe quick brown fox[0m Underline Yellow (on Cyan background) -[7;33;46mthe quick brown fox[0m Inverse Yellow (on Cyan background) -[1;34;46mthe quick brown fox[0m Bright Blue (on Cyan background) -[4;34;46mthe quick brown fox[0m Underline Blue (on Cyan background) -[7;34;46mthe quick brown fox[0m Inverse Blue (on Cyan background) -[1;35;46mthe quick brown fox[0m Bright Magenta (on Cyan background) -[4;35;46mthe quick brown fox[0m Underline Magenta (on Cyan background) -[7;35;46mthe quick brown fox[0m Inverse Magenta (on Cyan background) -[1;36;46mthe quick brown fox[0m Bright Cyan (on Cyan background) -[4;36;46mthe quick brown fox[0m Underline Cyan (on Cyan background) -[7;36;46mthe quick brown fox[0m Inverse Cyan (on Cyan background) -[1;37;46mthe quick brown fox[0m Bright White (on Cyan background) -[4;37;46mthe quick brown fox[0m Underline White (on Cyan background) -[7;37;46mthe quick brown fox[0m Inverse White (on Cyan background) -[1;30;47mthe quick brown fox[0m Bright Black (on White background) -[4;30;47mthe quick brown fox[0m Underline Black (on White background) -[7;30;47mthe quick brown fox[0m Inverse Black (on White background) -[1;31;47mthe quick brown fox[0m Bright Red (on White background) -[4;31;47mthe quick brown fox[0m Underline Red (on White background) -[7;31;47mthe quick brown fox[0m Inverse Red (on White background) -[1;32;47mthe quick brown fox[0m Bright Green (on White background) -[4;32;47mthe quick brown fox[0m Underline Green (on White background) -[7;32;47mthe quick brown fox[0m Inverse Green (on White background) -[1;33;47mthe quick brown fox[0m Bright Yellow (on White background) -[4;33;47mthe quick brown fox[0m Underline Yellow (on White background) -[7;33;47mthe quick brown fox[0m Inverse Yellow (on White background) -[1;34;47mthe quick brown fox[0m Bright Blue (on White background) -[4;34;47mthe quick brown fox[0m Underline Blue (on White background) -[7;34;47mthe quick brown fox[0m Inverse Blue (on White background) -[1;35;47mthe quick brown fox[0m Bright Magenta (on White background) -[4;35;47mthe quick brown fox[0m Underline Magenta (on White background) -[7;35;47mthe quick brown fox[0m Inverse Magenta (on White background) -[1;36;47mthe quick brown fox[0m Bright Cyan (on White background) -[4;36;47mthe quick brown fox[0m Underline Cyan (on White background) -[7;36;47mthe quick brown fox[0m Inverse Cyan (on White background) -[1;37;47mthe quick brown fox[0m Bright White (on White background) -[4;37;47mthe quick brown fox[0m Underline White (on White background) -[7;37;47mthe quick brown fox[0m Inverse White (on White background) - -2 colors 2 effects -[1;4;30;40mthe quick brown fox[0m Bright Underline Black (on Black background) -[1;7;30;40mthe quick brown fox[0m Bright Inverse Black (on Black background) -[4;1;30;40mthe quick brown fox[0m Underline Bright Black (on Black background) -[4;7;30;40mthe quick brown fox[0m Underline Inverse Black (on Black background) -[7;1;30;40mthe quick brown fox[0m Inverse Bright Black (on Black background) -[7;4;30;40mthe quick brown fox[0m Inverse Underline Black (on Black background) -[1;4;31;40mthe quick brown fox[0m Bright Underline Red (on Black background) -[1;7;31;40mthe quick brown fox[0m Bright Inverse Red (on Black background) -[4;1;31;40mthe quick brown fox[0m Underline Bright Red (on Black background) -[4;7;31;40mthe quick brown fox[0m Underline Inverse Red (on Black background) -[7;1;31;40mthe quick brown fox[0m Inverse Bright Red (on Black background) -[7;4;31;40mthe quick brown fox[0m Inverse Underline Red (on Black background) -[1;4;32;40mthe quick brown fox[0m Bright Underline Green (on Black background) -[1;7;32;40mthe quick brown fox[0m Bright Inverse Green (on Black background) -[4;1;32;40mthe quick brown fox[0m Underline Bright Green (on Black background) -[4;7;32;40mthe quick brown fox[0m Underline Inverse Green (on Black background) -[7;1;32;40mthe quick brown fox[0m Inverse Bright Green (on Black background) -[7;4;32;40mthe quick brown fox[0m Inverse Underline Green (on Black background) -[1;4;33;40mthe quick brown fox[0m Bright Underline Yellow (on Black background) -[1;7;33;40mthe quick brown fox[0m Bright Inverse Yellow (on Black background) -[4;1;33;40mthe quick brown fox[0m Underline Bright Yellow (on Black background) -[4;7;33;40mthe quick brown fox[0m Underline Inverse Yellow (on Black background) -[7;1;33;40mthe quick brown fox[0m Inverse Bright Yellow (on Black background) -[7;4;33;40mthe quick brown fox[0m Inverse Underline Yellow (on Black background) -[1;4;34;40mthe quick brown fox[0m Bright Underline Blue (on Black background) -[1;7;34;40mthe quick brown fox[0m Bright Inverse Blue (on Black background) -[4;1;34;40mthe quick brown fox[0m Underline Bright Blue (on Black background) -[4;7;34;40mthe quick brown fox[0m Underline Inverse Blue (on Black background) -[7;1;34;40mthe quick brown fox[0m Inverse Bright Blue (on Black background) -[7;4;34;40mthe quick brown fox[0m Inverse Underline Blue (on Black background) -[1;4;35;40mthe quick brown fox[0m Bright Underline Magenta (on Black background) -[1;7;35;40mthe quick brown fox[0m Bright Inverse Magenta (on Black background) -[4;1;35;40mthe quick brown fox[0m Underline Bright Magenta (on Black background) -[4;7;35;40mthe quick brown fox[0m Underline Inverse Magenta (on Black background) -[7;1;35;40mthe quick brown fox[0m Inverse Bright Magenta (on Black background) -[7;4;35;40mthe quick brown fox[0m Inverse Underline Magenta (on Black background) -[1;4;36;40mthe quick brown fox[0m Bright Underline Cyan (on Black background) -[1;7;36;40mthe quick brown fox[0m Bright Inverse Cyan (on Black background) -[4;1;36;40mthe quick brown fox[0m Underline Bright Cyan (on Black background) -[4;7;36;40mthe quick brown fox[0m Underline Inverse Cyan (on Black background) -[7;1;36;40mthe quick brown fox[0m Inverse Bright Cyan (on Black background) -[7;4;36;40mthe quick brown fox[0m Inverse Underline Cyan (on Black background) -[1;4;37;40mthe quick brown fox[0m Bright Underline White (on Black background) -[1;7;37;40mthe quick brown fox[0m Bright Inverse White (on Black background) -[4;1;37;40mthe quick brown fox[0m Underline Bright White (on Black background) -[4;7;37;40mthe quick brown fox[0m Underline Inverse White (on Black background) -[7;1;37;40mthe quick brown fox[0m Inverse Bright White (on Black background) -[7;4;37;40mthe quick brown fox[0m Inverse Underline White (on Black background) -[1;4;30;41mthe quick brown fox[0m Bright Underline Black (on Red background) -[1;7;30;41mthe quick brown fox[0m Bright Inverse Black (on Red background) -[4;1;30;41mthe quick brown fox[0m Underline Bright Black (on Red background) -[4;7;30;41mthe quick brown fox[0m Underline Inverse Black (on Red background) -[7;1;30;41mthe quick brown fox[0m Inverse Bright Black (on Red background) -[7;4;30;41mthe quick brown fox[0m Inverse Underline Black (on Red background) -[1;4;31;41mthe quick brown fox[0m Bright Underline Red (on Red background) -[1;7;31;41mthe quick brown fox[0m Bright Inverse Red (on Red background) -[4;1;31;41mthe quick brown fox[0m Underline Bright Red (on Red background) -[4;7;31;41mthe quick brown fox[0m Underline Inverse Red (on Red background) -[7;1;31;41mthe quick brown fox[0m Inverse Bright Red (on Red background) -[7;4;31;41mthe quick brown fox[0m Inverse Underline Red (on Red background) -[1;4;32;41mthe quick brown fox[0m Bright Underline Green (on Red background) -[1;7;32;41mthe quick brown fox[0m Bright Inverse Green (on Red background) -[4;1;32;41mthe quick brown fox[0m Underline Bright Green (on Red background) -[4;7;32;41mthe quick brown fox[0m Underline Inverse Green (on Red background) -[7;1;32;41mthe quick brown fox[0m Inverse Bright Green (on Red background) -[7;4;32;41mthe quick brown fox[0m Inverse Underline Green (on Red background) -[1;4;33;41mthe quick brown fox[0m Bright Underline Yellow (on Red background) -[1;7;33;41mthe quick brown fox[0m Bright Inverse Yellow (on Red background) -[4;1;33;41mthe quick brown fox[0m Underline Bright Yellow (on Red background) -[4;7;33;41mthe quick brown fox[0m Underline Inverse Yellow (on Red background) -[7;1;33;41mthe quick brown fox[0m Inverse Bright Yellow (on Red background) -[7;4;33;41mthe quick brown fox[0m Inverse Underline Yellow (on Red background) -[1;4;34;41mthe quick brown fox[0m Bright Underline Blue (on Red background) -[1;7;34;41mthe quick brown fox[0m Bright Inverse Blue (on Red background) -[4;1;34;41mthe quick brown fox[0m Underline Bright Blue (on Red background) -[4;7;34;41mthe quick brown fox[0m Underline Inverse Blue (on Red background) -[7;1;34;41mthe quick brown fox[0m Inverse Bright Blue (on Red background) -[7;4;34;41mthe quick brown fox[0m Inverse Underline Blue (on Red background) -[1;4;35;41mthe quick brown fox[0m Bright Underline Magenta (on Red background) -[1;7;35;41mthe quick brown fox[0m Bright Inverse Magenta (on Red background) -[4;1;35;41mthe quick brown fox[0m Underline Bright Magenta (on Red background) -[4;7;35;41mthe quick brown fox[0m Underline Inverse Magenta (on Red background) -[7;1;35;41mthe quick brown fox[0m Inverse Bright Magenta (on Red background) -[7;4;35;41mthe quick brown fox[0m Inverse Underline Magenta (on Red background) -[1;4;36;41mthe quick brown fox[0m Bright Underline Cyan (on Red background) -[1;7;36;41mthe quick brown fox[0m Bright Inverse Cyan (on Red background) -[4;1;36;41mthe quick brown fox[0m Underline Bright Cyan (on Red background) -[4;7;36;41mthe quick brown fox[0m Underline Inverse Cyan (on Red background) -[7;1;36;41mthe quick brown fox[0m Inverse Bright Cyan (on Red background) -[7;4;36;41mthe quick brown fox[0m Inverse Underline Cyan (on Red background) -[1;4;37;41mthe quick brown fox[0m Bright Underline White (on Red background) -[1;7;37;41mthe quick brown fox[0m Bright Inverse White (on Red background) -[4;1;37;41mthe quick brown fox[0m Underline Bright White (on Red background) -[4;7;37;41mthe quick brown fox[0m Underline Inverse White (on Red background) -[7;1;37;41mthe quick brown fox[0m Inverse Bright White (on Red background) -[7;4;37;41mthe quick brown fox[0m Inverse Underline White (on Red background) -[1;4;30;42mthe quick brown fox[0m Bright Underline Black (on Green background) -[1;7;30;42mthe quick brown fox[0m Bright Inverse Black (on Green background) -[4;1;30;42mthe quick brown fox[0m Underline Bright Black (on Green background) -[4;7;30;42mthe quick brown fox[0m Underline Inverse Black (on Green background) -[7;1;30;42mthe quick brown fox[0m Inverse Bright Black (on Green background) -[7;4;30;42mthe quick brown fox[0m Inverse Underline Black (on Green background) -[1;4;31;42mthe quick brown fox[0m Bright Underline Red (on Green background) -[1;7;31;42mthe quick brown fox[0m Bright Inverse Red (on Green background) -[4;1;31;42mthe quick brown fox[0m Underline Bright Red (on Green background) -[4;7;31;42mthe quick brown fox[0m Underline Inverse Red (on Green background) -[7;1;31;42mthe quick brown fox[0m Inverse Bright Red (on Green background) -[7;4;31;42mthe quick brown fox[0m Inverse Underline Red (on Green background) -[1;4;32;42mthe quick brown fox[0m Bright Underline Green (on Green background) -[1;7;32;42mthe quick brown fox[0m Bright Inverse Green (on Green background) -[4;1;32;42mthe quick brown fox[0m Underline Bright Green (on Green background) -[4;7;32;42mthe quick brown fox[0m Underline Inverse Green (on Green background) -[7;1;32;42mthe quick brown fox[0m Inverse Bright Green (on Green background) -[7;4;32;42mthe quick brown fox[0m Inverse Underline Green (on Green background) -[1;4;33;42mthe quick brown fox[0m Bright Underline Yellow (on Green background) -[1;7;33;42mthe quick brown fox[0m Bright Inverse Yellow (on Green background) -[4;1;33;42mthe quick brown fox[0m Underline Bright Yellow (on Green background) -[4;7;33;42mthe quick brown fox[0m Underline Inverse Yellow (on Green background) -[7;1;33;42mthe quick brown fox[0m Inverse Bright Yellow (on Green background) -[7;4;33;42mthe quick brown fox[0m Inverse Underline Yellow (on Green background) -[1;4;34;42mthe quick brown fox[0m Bright Underline Blue (on Green background) -[1;7;34;42mthe quick brown fox[0m Bright Inverse Blue (on Green background) -[4;1;34;42mthe quick brown fox[0m Underline Bright Blue (on Green background) -[4;7;34;42mthe quick brown fox[0m Underline Inverse Blue (on Green background) -[7;1;34;42mthe quick brown fox[0m Inverse Bright Blue (on Green background) -[7;4;34;42mthe quick brown fox[0m Inverse Underline Blue (on Green background) -[1;4;35;42mthe quick brown fox[0m Bright Underline Magenta (on Green background) -[1;7;35;42mthe quick brown fox[0m Bright Inverse Magenta (on Green background) -[4;1;35;42mthe quick brown fox[0m Underline Bright Magenta (on Green background) -[4;7;35;42mthe quick brown fox[0m Underline Inverse Magenta (on Green background) -[7;1;35;42mthe quick brown fox[0m Inverse Bright Magenta (on Green background) -[7;4;35;42mthe quick brown fox[0m Inverse Underline Magenta (on Green background) -[1;4;36;42mthe quick brown fox[0m Bright Underline Cyan (on Green background) -[1;7;36;42mthe quick brown fox[0m Bright Inverse Cyan (on Green background) -[4;1;36;42mthe quick brown fox[0m Underline Bright Cyan (on Green background) -[4;7;36;42mthe quick brown fox[0m Underline Inverse Cyan (on Green background) -[7;1;36;42mthe quick brown fox[0m Inverse Bright Cyan (on Green background) -[7;4;36;42mthe quick brown fox[0m Inverse Underline Cyan (on Green background) -[1;4;37;42mthe quick brown fox[0m Bright Underline White (on Green background) -[1;7;37;42mthe quick brown fox[0m Bright Inverse White (on Green background) -[4;1;37;42mthe quick brown fox[0m Underline Bright White (on Green background) -[4;7;37;42mthe quick brown fox[0m Underline Inverse White (on Green background) -[7;1;37;42mthe quick brown fox[0m Inverse Bright White (on Green background) -[7;4;37;42mthe quick brown fox[0m Inverse Underline White (on Green background) -[1;4;30;43mthe quick brown fox[0m Bright Underline Black (on Yellow background) -[1;7;30;43mthe quick brown fox[0m Bright Inverse Black (on Yellow background) -[4;1;30;43mthe quick brown fox[0m Underline Bright Black (on Yellow background) -[4;7;30;43mthe quick brown fox[0m Underline Inverse Black (on Yellow background) -[7;1;30;43mthe quick brown fox[0m Inverse Bright Black (on Yellow background) -[7;4;30;43mthe quick brown fox[0m Inverse Underline Black (on Yellow background) -[1;4;31;43mthe quick brown fox[0m Bright Underline Red (on Yellow background) -[1;7;31;43mthe quick brown fox[0m Bright Inverse Red (on Yellow background) -[4;1;31;43mthe quick brown fox[0m Underline Bright Red (on Yellow background) -[4;7;31;43mthe quick brown fox[0m Underline Inverse Red (on Yellow background) -[7;1;31;43mthe quick brown fox[0m Inverse Bright Red (on Yellow background) -[7;4;31;43mthe quick brown fox[0m Inverse Underline Red (on Yellow background) -[1;4;32;43mthe quick brown fox[0m Bright Underline Green (on Yellow background) -[1;7;32;43mthe quick brown fox[0m Bright Inverse Green (on Yellow background) -[4;1;32;43mthe quick brown fox[0m Underline Bright Green (on Yellow background) -[4;7;32;43mthe quick brown fox[0m Underline Inverse Green (on Yellow background) -[7;1;32;43mthe quick brown fox[0m Inverse Bright Green (on Yellow background) -[7;4;32;43mthe quick brown fox[0m Inverse Underline Green (on Yellow background) -[1;4;33;43mthe quick brown fox[0m Bright Underline Yellow (on Yellow background) -[1;7;33;43mthe quick brown fox[0m Bright Inverse Yellow (on Yellow background) -[4;1;33;43mthe quick brown fox[0m Underline Bright Yellow (on Yellow background) -[4;7;33;43mthe quick brown fox[0m Underline Inverse Yellow (on Yellow background) -[7;1;33;43mthe quick brown fox[0m Inverse Bright Yellow (on Yellow background) -[7;4;33;43mthe quick brown fox[0m Inverse Underline Yellow (on Yellow background) -[1;4;34;43mthe quick brown fox[0m Bright Underline Blue (on Yellow background) -[1;7;34;43mthe quick brown fox[0m Bright Inverse Blue (on Yellow background) -[4;1;34;43mthe quick brown fox[0m Underline Bright Blue (on Yellow background) -[4;7;34;43mthe quick brown fox[0m Underline Inverse Blue (on Yellow background) -[7;1;34;43mthe quick brown fox[0m Inverse Bright Blue (on Yellow background) -[7;4;34;43mthe quick brown fox[0m Inverse Underline Blue (on Yellow background) -[1;4;35;43mthe quick brown fox[0m Bright Underline Magenta (on Yellow background) -[1;7;35;43mthe quick brown fox[0m Bright Inverse Magenta (on Yellow background) -[4;1;35;43mthe quick brown fox[0m Underline Bright Magenta (on Yellow background) -[4;7;35;43mthe quick brown fox[0m Underline Inverse Magenta (on Yellow background) -[7;1;35;43mthe quick brown fox[0m Inverse Bright Magenta (on Yellow background) -[7;4;35;43mthe quick brown fox[0m Inverse Underline Magenta (on Yellow background) -[1;4;36;43mthe quick brown fox[0m Bright Underline Cyan (on Yellow background) -[1;7;36;43mthe quick brown fox[0m Bright Inverse Cyan (on Yellow background) -[4;1;36;43mthe quick brown fox[0m Underline Bright Cyan (on Yellow background) -[4;7;36;43mthe quick brown fox[0m Underline Inverse Cyan (on Yellow background) -[7;1;36;43mthe quick brown fox[0m Inverse Bright Cyan (on Yellow background) -[7;4;36;43mthe quick brown fox[0m Inverse Underline Cyan (on Yellow background) -[1;4;37;43mthe quick brown fox[0m Bright Underline White (on Yellow background) -[1;7;37;43mthe quick brown fox[0m Bright Inverse White (on Yellow background) -[4;1;37;43mthe quick brown fox[0m Underline Bright White (on Yellow background) -[4;7;37;43mthe quick brown fox[0m Underline Inverse White (on Yellow background) -[7;1;37;43mthe quick brown fox[0m Inverse Bright White (on Yellow background) -[7;4;37;43mthe quick brown fox[0m Inverse Underline White (on Yellow background) -[1;4;30;44mthe quick brown fox[0m Bright Underline Black (on Blue background) -[1;7;30;44mthe quick brown fox[0m Bright Inverse Black (on Blue background) -[4;1;30;44mthe quick brown fox[0m Underline Bright Black (on Blue background) -[4;7;30;44mthe quick brown fox[0m Underline Inverse Black (on Blue background) -[7;1;30;44mthe quick brown fox[0m Inverse Bright Black (on Blue background) -[7;4;30;44mthe quick brown fox[0m Inverse Underline Black (on Blue background) -[1;4;31;44mthe quick brown fox[0m Bright Underline Red (on Blue background) -[1;7;31;44mthe quick brown fox[0m Bright Inverse Red (on Blue background) -[4;1;31;44mthe quick brown fox[0m Underline Bright Red (on Blue background) -[4;7;31;44mthe quick brown fox[0m Underline Inverse Red (on Blue background) -[7;1;31;44mthe quick brown fox[0m Inverse Bright Red (on Blue background) -[7;4;31;44mthe quick brown fox[0m Inverse Underline Red (on Blue background) -[1;4;32;44mthe quick brown fox[0m Bright Underline Green (on Blue background) -[1;7;32;44mthe quick brown fox[0m Bright Inverse Green (on Blue background) -[4;1;32;44mthe quick brown fox[0m Underline Bright Green (on Blue background) -[4;7;32;44mthe quick brown fox[0m Underline Inverse Green (on Blue background) -[7;1;32;44mthe quick brown fox[0m Inverse Bright Green (on Blue background) -[7;4;32;44mthe quick brown fox[0m Inverse Underline Green (on Blue background) -[1;4;33;44mthe quick brown fox[0m Bright Underline Yellow (on Blue background) -[1;7;33;44mthe quick brown fox[0m Bright Inverse Yellow (on Blue background) -[4;1;33;44mthe quick brown fox[0m Underline Bright Yellow (on Blue background) -[4;7;33;44mthe quick brown fox[0m Underline Inverse Yellow (on Blue background) -[7;1;33;44mthe quick brown fox[0m Inverse Bright Yellow (on Blue background) -[7;4;33;44mthe quick brown fox[0m Inverse Underline Yellow (on Blue background) -[1;4;34;44mthe quick brown fox[0m Bright Underline Blue (on Blue background) -[1;7;34;44mthe quick brown fox[0m Bright Inverse Blue (on Blue background) -[4;1;34;44mthe quick brown fox[0m Underline Bright Blue (on Blue background) -[4;7;34;44mthe quick brown fox[0m Underline Inverse Blue (on Blue background) -[7;1;34;44mthe quick brown fox[0m Inverse Bright Blue (on Blue background) -[7;4;34;44mthe quick brown fox[0m Inverse Underline Blue (on Blue background) -[1;4;35;44mthe quick brown fox[0m Bright Underline Magenta (on Blue background) -[1;7;35;44mthe quick brown fox[0m Bright Inverse Magenta (on Blue background) -[4;1;35;44mthe quick brown fox[0m Underline Bright Magenta (on Blue background) -[4;7;35;44mthe quick brown fox[0m Underline Inverse Magenta (on Blue background) -[7;1;35;44mthe quick brown fox[0m Inverse Bright Magenta (on Blue background) -[7;4;35;44mthe quick brown fox[0m Inverse Underline Magenta (on Blue background) -[1;4;36;44mthe quick brown fox[0m Bright Underline Cyan (on Blue background) -[1;7;36;44mthe quick brown fox[0m Bright Inverse Cyan (on Blue background) -[4;1;36;44mthe quick brown fox[0m Underline Bright Cyan (on Blue background) -[4;7;36;44mthe quick brown fox[0m Underline Inverse Cyan (on Blue background) -[7;1;36;44mthe quick brown fox[0m Inverse Bright Cyan (on Blue background) -[7;4;36;44mthe quick brown fox[0m Inverse Underline Cyan (on Blue background) -[1;4;37;44mthe quick brown fox[0m Bright Underline White (on Blue background) -[1;7;37;44mthe quick brown fox[0m Bright Inverse White (on Blue background) -[4;1;37;44mthe quick brown fox[0m Underline Bright White (on Blue background) -[4;7;37;44mthe quick brown fox[0m Underline Inverse White (on Blue background) -[7;1;37;44mthe quick brown fox[0m Inverse Bright White (on Blue background) -[7;4;37;44mthe quick brown fox[0m Inverse Underline White (on Blue background) -[1;4;30;45mthe quick brown fox[0m Bright Underline Black (on Magenta background) -[1;7;30;45mthe quick brown fox[0m Bright Inverse Black (on Magenta background) -[4;1;30;45mthe quick brown fox[0m Underline Bright Black (on Magenta background) -[4;7;30;45mthe quick brown fox[0m Underline Inverse Black (on Magenta background) -[7;1;30;45mthe quick brown fox[0m Inverse Bright Black (on Magenta background) -[7;4;30;45mthe quick brown fox[0m Inverse Underline Black (on Magenta background) -[1;4;31;45mthe quick brown fox[0m Bright Underline Red (on Magenta background) -[1;7;31;45mthe quick brown fox[0m Bright Inverse Red (on Magenta background) -[4;1;31;45mthe quick brown fox[0m Underline Bright Red (on Magenta background) -[4;7;31;45mthe quick brown fox[0m Underline Inverse Red (on Magenta background) -[7;1;31;45mthe quick brown fox[0m Inverse Bright Red (on Magenta background) -[7;4;31;45mthe quick brown fox[0m Inverse Underline Red (on Magenta background) -[1;4;32;45mthe quick brown fox[0m Bright Underline Green (on Magenta background) -[1;7;32;45mthe quick brown fox[0m Bright Inverse Green (on Magenta background) -[4;1;32;45mthe quick brown fox[0m Underline Bright Green (on Magenta background) -[4;7;32;45mthe quick brown fox[0m Underline Inverse Green (on Magenta background) -[7;1;32;45mthe quick brown fox[0m Inverse Bright Green (on Magenta background) -[7;4;32;45mthe quick brown fox[0m Inverse Underline Green (on Magenta background) -[1;4;33;45mthe quick brown fox[0m Bright Underline Yellow (on Magenta background) -[1;7;33;45mthe quick brown fox[0m Bright Inverse Yellow (on Magenta background) -[4;1;33;45mthe quick brown fox[0m Underline Bright Yellow (on Magenta background) -[4;7;33;45mthe quick brown fox[0m Underline Inverse Yellow (on Magenta background) -[7;1;33;45mthe quick brown fox[0m Inverse Bright Yellow (on Magenta background) -[7;4;33;45mthe quick brown fox[0m Inverse Underline Yellow (on Magenta background) -[1;4;34;45mthe quick brown fox[0m Bright Underline Blue (on Magenta background) -[1;7;34;45mthe quick brown fox[0m Bright Inverse Blue (on Magenta background) -[4;1;34;45mthe quick brown fox[0m Underline Bright Blue (on Magenta background) -[4;7;34;45mthe quick brown fox[0m Underline Inverse Blue (on Magenta background) -[7;1;34;45mthe quick brown fox[0m Inverse Bright Blue (on Magenta background) -[7;4;34;45mthe quick brown fox[0m Inverse Underline Blue (on Magenta background) -[1;4;35;45mthe quick brown fox[0m Bright Underline Magenta (on Magenta background) -[1;7;35;45mthe quick brown fox[0m Bright Inverse Magenta (on Magenta background) -[4;1;35;45mthe quick brown fox[0m Underline Bright Magenta (on Magenta background) -[4;7;35;45mthe quick brown fox[0m Underline Inverse Magenta (on Magenta background) -[7;1;35;45mthe quick brown fox[0m Inverse Bright Magenta (on Magenta background) -[7;4;35;45mthe quick brown fox[0m Inverse Underline Magenta (on Magenta background) -[1;4;36;45mthe quick brown fox[0m Bright Underline Cyan (on Magenta background) -[1;7;36;45mthe quick brown fox[0m Bright Inverse Cyan (on Magenta background) -[4;1;36;45mthe quick brown fox[0m Underline Bright Cyan (on Magenta background) -[4;7;36;45mthe quick brown fox[0m Underline Inverse Cyan (on Magenta background) -[7;1;36;45mthe quick brown fox[0m Inverse Bright Cyan (on Magenta background) -[7;4;36;45mthe quick brown fox[0m Inverse Underline Cyan (on Magenta background) -[1;4;37;45mthe quick brown fox[0m Bright Underline White (on Magenta background) -[1;7;37;45mthe quick brown fox[0m Bright Inverse White (on Magenta background) -[4;1;37;45mthe quick brown fox[0m Underline Bright White (on Magenta background) -[4;7;37;45mthe quick brown fox[0m Underline Inverse White (on Magenta background) -[7;1;37;45mthe quick brown fox[0m Inverse Bright White (on Magenta background) -[7;4;37;45mthe quick brown fox[0m Inverse Underline White (on Magenta background) -[1;4;30;46mthe quick brown fox[0m Bright Underline Black (on Cyan background) -[1;7;30;46mthe quick brown fox[0m Bright Inverse Black (on Cyan background) -[4;1;30;46mthe quick brown fox[0m Underline Bright Black (on Cyan background) -[4;7;30;46mthe quick brown fox[0m Underline Inverse Black (on Cyan background) -[7;1;30;46mthe quick brown fox[0m Inverse Bright Black (on Cyan background) -[7;4;30;46mthe quick brown fox[0m Inverse Underline Black (on Cyan background) -[1;4;31;46mthe quick brown fox[0m Bright Underline Red (on Cyan background) -[1;7;31;46mthe quick brown fox[0m Bright Inverse Red (on Cyan background) -[4;1;31;46mthe quick brown fox[0m Underline Bright Red (on Cyan background) -[4;7;31;46mthe quick brown fox[0m Underline Inverse Red (on Cyan background) -[7;1;31;46mthe quick brown fox[0m Inverse Bright Red (on Cyan background) -[7;4;31;46mthe quick brown fox[0m Inverse Underline Red (on Cyan background) -[1;4;32;46mthe quick brown fox[0m Bright Underline Green (on Cyan background) -[1;7;32;46mthe quick brown fox[0m Bright Inverse Green (on Cyan background) -[4;1;32;46mthe quick brown fox[0m Underline Bright Green (on Cyan background) -[4;7;32;46mthe quick brown fox[0m Underline Inverse Green (on Cyan background) -[7;1;32;46mthe quick brown fox[0m Inverse Bright Green (on Cyan background) -[7;4;32;46mthe quick brown fox[0m Inverse Underline Green (on Cyan background) -[1;4;33;46mthe quick brown fox[0m Bright Underline Yellow (on Cyan background) -[1;7;33;46mthe quick brown fox[0m Bright Inverse Yellow (on Cyan background) -[4;1;33;46mthe quick brown fox[0m Underline Bright Yellow (on Cyan background) -[4;7;33;46mthe quick brown fox[0m Underline Inverse Yellow (on Cyan background) -[7;1;33;46mthe quick brown fox[0m Inverse Bright Yellow (on Cyan background) -[7;4;33;46mthe quick brown fox[0m Inverse Underline Yellow (on Cyan background) -[1;4;34;46mthe quick brown fox[0m Bright Underline Blue (on Cyan background) -[1;7;34;46mthe quick brown fox[0m Bright Inverse Blue (on Cyan background) -[4;1;34;46mthe quick brown fox[0m Underline Bright Blue (on Cyan background) -[4;7;34;46mthe quick brown fox[0m Underline Inverse Blue (on Cyan background) -[7;1;34;46mthe quick brown fox[0m Inverse Bright Blue (on Cyan background) -[7;4;34;46mthe quick brown fox[0m Inverse Underline Blue (on Cyan background) -[1;4;35;46mthe quick brown fox[0m Bright Underline Magenta (on Cyan background) -[1;7;35;46mthe quick brown fox[0m Bright Inverse Magenta (on Cyan background) -[4;1;35;46mthe quick brown fox[0m Underline Bright Magenta (on Cyan background) -[4;7;35;46mthe quick brown fox[0m Underline Inverse Magenta (on Cyan background) -[7;1;35;46mthe quick brown fox[0m Inverse Bright Magenta (on Cyan background) -[7;4;35;46mthe quick brown fox[0m Inverse Underline Magenta (on Cyan background) -[1;4;36;46mthe quick brown fox[0m Bright Underline Cyan (on Cyan background) -[1;7;36;46mthe quick brown fox[0m Bright Inverse Cyan (on Cyan background) -[4;1;36;46mthe quick brown fox[0m Underline Bright Cyan (on Cyan background) -[4;7;36;46mthe quick brown fox[0m Underline Inverse Cyan (on Cyan background) -[7;1;36;46mthe quick brown fox[0m Inverse Bright Cyan (on Cyan background) -[7;4;36;46mthe quick brown fox[0m Inverse Underline Cyan (on Cyan background) -[1;4;37;46mthe quick brown fox[0m Bright Underline White (on Cyan background) -[1;7;37;46mthe quick brown fox[0m Bright Inverse White (on Cyan background) -[4;1;37;46mthe quick brown fox[0m Underline Bright White (on Cyan background) -[4;7;37;46mthe quick brown fox[0m Underline Inverse White (on Cyan background) -[7;1;37;46mthe quick brown fox[0m Inverse Bright White (on Cyan background) -[7;4;37;46mthe quick brown fox[0m Inverse Underline White (on Cyan background) -[1;4;30;47mthe quick brown fox[0m Bright Underline Black (on White background) -[1;7;30;47mthe quick brown fox[0m Bright Inverse Black (on White background) -[4;1;30;47mthe quick brown fox[0m Underline Bright Black (on White background) -[4;7;30;47mthe quick brown fox[0m Underline Inverse Black (on White background) -[7;1;30;47mthe quick brown fox[0m Inverse Bright Black (on White background) -[7;4;30;47mthe quick brown fox[0m Inverse Underline Black (on White background) -[1;4;31;47mthe quick brown fox[0m Bright Underline Red (on White background) -[1;7;31;47mthe quick brown fox[0m Bright Inverse Red (on White background) -[4;1;31;47mthe quick brown fox[0m Underline Bright Red (on White background) -[4;7;31;47mthe quick brown fox[0m Underline Inverse Red (on White background) -[7;1;31;47mthe quick brown fox[0m Inverse Bright Red (on White background) -[7;4;31;47mthe quick brown fox[0m Inverse Underline Red (on White background) -[1;4;32;47mthe quick brown fox[0m Bright Underline Green (on White background) -[1;7;32;47mthe quick brown fox[0m Bright Inverse Green (on White background) -[4;1;32;47mthe quick brown fox[0m Underline Bright Green (on White background) -[4;7;32;47mthe quick brown fox[0m Underline Inverse Green (on White background) -[7;1;32;47mthe quick brown fox[0m Inverse Bright Green (on White background) -[7;4;32;47mthe quick brown fox[0m Inverse Underline Green (on White background) -[1;4;33;47mthe quick brown fox[0m Bright Underline Yellow (on White background) -[1;7;33;47mthe quick brown fox[0m Bright Inverse Yellow (on White background) -[4;1;33;47mthe quick brown fox[0m Underline Bright Yellow (on White background) -[4;7;33;47mthe quick brown fox[0m Underline Inverse Yellow (on White background) -[7;1;33;47mthe quick brown fox[0m Inverse Bright Yellow (on White background) -[7;4;33;47mthe quick brown fox[0m Inverse Underline Yellow (on White background) -[1;4;34;47mthe quick brown fox[0m Bright Underline Blue (on White background) -[1;7;34;47mthe quick brown fox[0m Bright Inverse Blue (on White background) -[4;1;34;47mthe quick brown fox[0m Underline Bright Blue (on White background) -[4;7;34;47mthe quick brown fox[0m Underline Inverse Blue (on White background) -[7;1;34;47mthe quick brown fox[0m Inverse Bright Blue (on White background) -[7;4;34;47mthe quick brown fox[0m Inverse Underline Blue (on White background) -[1;4;35;47mthe quick brown fox[0m Bright Underline Magenta (on White background) -[1;7;35;47mthe quick brown fox[0m Bright Inverse Magenta (on White background) -[4;1;35;47mthe quick brown fox[0m Underline Bright Magenta (on White background) -[4;7;35;47mthe quick brown fox[0m Underline Inverse Magenta (on White background) -[7;1;35;47mthe quick brown fox[0m Inverse Bright Magenta (on White background) -[7;4;35;47mthe quick brown fox[0m Inverse Underline Magenta (on White background) -[1;4;36;47mthe quick brown fox[0m Bright Underline Cyan (on White background) -[1;7;36;47mthe quick brown fox[0m Bright Inverse Cyan (on White background) -[4;1;36;47mthe quick brown fox[0m Underline Bright Cyan (on White background) -[4;7;36;47mthe quick brown fox[0m Underline Inverse Cyan (on White background) -[7;1;36;47mthe quick brown fox[0m Inverse Bright Cyan (on White background) -[7;4;36;47mthe quick brown fox[0m Inverse Underline Cyan (on White background) -[1;4;37;47mthe quick brown fox[0m Bright Underline White (on White background) -[1;7;37;47mthe quick brown fox[0m Bright Inverse White (on White background) -[4;1;37;47mthe quick brown fox[0m Underline Bright White (on White background) -[4;7;37;47mthe quick brown fox[0m Underline Inverse White (on White background) -[7;1;37;47mthe quick brown fox[0m Inverse Bright White (on White background) -[7;4;37;47mthe quick brown fox[0m Inverse Underline White (on White background) diff --git a/test/files/run/color.scala b/test/files/run/color.scala deleted file mode 100644 index a0af8477e7..0000000000 --- a/test/files/run/color.scala +++ /dev/null @@ -1,33 +0,0 @@ -import scala.tools.util.color._ - -object Test { - // The ones which are somewhat widely supported. - def effects = List(Bright, Underline, Inverse) - - def demo(text: String) = { - def to_s(esc: Ansi): String = esc.atoms map { - case x: AnsiBackground => "" + x - case x => "%-10s" format x - } mkString " " - - def show(esc: Ansi) = println("%s %s".format(text in esc, to_s(esc))) - - println("\n1 color") - for (c <- Ansi.colors) show(c) - println("\n1 effect") - for (e <- Ansi.effects) show(e) - println("\n1 color 1 effect") - for (c <- Ansi.colors; e <- effects) show(c / e) - println("\n2 colors 0 effects") - for (c1 <- Ansi.colors ; c2 <- Ansi.colors) show(c2 on c1) - println("\n2 colors 1 effect") - for (c1 <- Ansi.colors ; c2 <- Ansi.colors ; e1 <- effects) show((c2 on c1) / e1) - println("\n2 colors 2 effects") - for (c1 <- Ansi.colors ; c2 <- Ansi.colors ; e1 <- effects ; e2 <- effects ; if e1 != e2) show((c2 on c1) / e1 / e2) - } - - def main(args: Array[String]): Unit = { - val str = if (args.size > 1) args mkString " " else "the quick brown fox" - demo(str) - } -} diff --git a/test/files/run/enrich-gentraversable.check b/test/files/run/enrich-gentraversable.check new file mode 100644 index 0000000000..348b38d6a4 --- /dev/null +++ b/test/files/run/enrich-gentraversable.check @@ -0,0 +1,4 @@ +List(2, 4) +Array(2, 4) +HW +Vector(72, 108, 108, 32, 114, 108, 100) diff --git a/test/files/run/enrich-gentraversable.scala b/test/files/run/enrich-gentraversable.scala new file mode 100644 index 0000000000..c9320ff985 --- /dev/null +++ b/test/files/run/enrich-gentraversable.scala @@ -0,0 +1,30 @@ +object Test extends App { + import scala.collection.generic.{ CanBuildFrom, FromRepr, HasElem } + + def typed[T](t : => T) {} + + class FilterMapImpl[A, Repr](val r : Repr)(implicit hasElem : HasElem[Repr, A]) { + def filterMap[B, That](f : A => Option[B])(implicit cbf : CanBuildFrom[Repr, B, That]) : That = r.flatMap(f(_).toSeq) + } + + implicit def filterMap[Repr : FromRepr](r : Repr) = new FilterMapImpl(r) + + val l = List(1, 2, 3, 4, 5) + val fml = l.filterMap(i => if(i % 2 == 0) Some(i) else None) + typed[List[Int]](fml) + println(fml) + + val a = Array(1, 2, 3, 4, 5) + val fma = a.filterMap(i => if(i % 2 == 0) Some(i) else None) + typed[Array[Int]](fma) + println(fma.deep) + + val s = "Hello World" + val fms1 = s.filterMap(c => if(c >= 'A' && c <= 'Z') Some(c) else None) + typed[String](fms1) + println(fms1) + + val fms2 = s.filterMap(c =>if(c % 2 == 0) Some(c.toInt) else None) + typed[IndexedSeq[Int]](fms2) + println(fms2) +} diff --git a/test/files/run/hashhash.scala b/test/files/run/hashhash.scala index b9cec99a12..f9fc067398 100644 --- a/test/files/run/hashhash.scala +++ b/test/files/run/hashhash.scala @@ -6,5 +6,18 @@ object Test { /** Just a little sanity check, not to be confused with a unit test. */ List(5, 5.5f, "abc", new AnyRef, ()) foreach confirmSame List(5.0f, 1.0d, -(5.0f), (-1.0d)) foreach confirmDifferent + + val x = (BigInt(1) << 64).toDouble + val y: Any = x + val f: Float = x.toFloat + val jn: java.lang.Number = x + val jf: java.lang.Float = x.toFloat + val jd: java.lang.Double = x + + assert(x.## == y.##, ((x, y))) + assert(x.## == f.##, ((x, f))) + assert(x.## == jn.##, ((x, jn))) + assert(x.## == jf.##, ((x, jf))) + assert(x.## == jd.##, ((x, jd))) } } diff --git a/test/files/run/inner-parse.check b/test/files/run/inner-parse.check deleted file mode 100644 index e4a30714bd..0000000000 --- a/test/files/run/inner-parse.check +++ /dev/null @@ -1,87 +0,0 @@ -file Test$$anonfun$main$1.class -class Test$$anonfun$main$1 extends scala.runtime.AbstractFunction1$mcVL$sp - interface scala.Serializable - inner/anon anonymous class: Test$$anonfun$main$1 - descriptor <clinit> ()V - descriptor apply (Lscala/Tuple2;)V - descriptor apply (Ljava/lang/Object;)Ljava/lang/Object; - descriptor apply (Ljava/lang/Object;)V - descriptor cwd$1 Ljava/lang/String; - descriptor serialVersionUID J - descriptor <init> (Ljava/lang/String;)V - signature apply (Lscala/Tuple2<Ljava/lang/String;Lscala/reflect/internal/JvmClassInfo;>;)V - -file Test$.class -class Test$ extends java.lang.Object - inner/anon anonymous class: Test$$anonfun$main$1 - descriptor <clinit> ()V - descriptor MODULE$ LTest$; - descriptor main ([Ljava/lang/String;)V - descriptor <init> ()V - -file Test.class -class Test extends java.lang.Object - inner/anon anonymous class: Test$$anonfun$main$1 - descriptor main ([Ljava/lang/String;)V - -file j/J_1$B$C$D.class -class j.J_1$B$C$D extends java.lang.Object - inner B j.J_1$B in j.J_1 - inner C j.J_1$B$C in j.J_1$B - inner/enclosing D enclosing class: j.J_1$B$C - descriptor <init> (Lj/J_1$B$C;)V - descriptor this$2 Lj/J_1$B$C; - -file j/J_1$B$C.class -class j.J_1$B$C extends java.lang.Object - inner B j.J_1$B in j.J_1 - inner/enclosing C enclosing class: j.J_1$B - inner/nested D member class: j.J_1$B$C$D - descriptor <init> (Lj/J_1$B;)V - descriptor this$1 Lj/J_1$B; - -file j/J_1$B.class -class j.J_1$B extends java.lang.Object - inner/enclosing B enclosing class: j.J_1 - inner/nested C member class: j.J_1$B$C - descriptor <init> (Lj/J_1;)V - descriptor this$0 Lj/J_1; - -file j/J_1.class -class j.J_1 extends java.lang.Object - interface java.util.RandomAccess - inner/nested B member class: j.J_1$B - descriptor <init> ()V - -file s/J_1$B$C$D.class -class s.J_1$B$C$D extends java.lang.Object - inner B s.J_1$B in s.J_1 - inner C s.J_1$B$C in s.J_1$B - inner/enclosing D enclosing class: s.J_1$B$C - descriptor $outer Ls/J_1$B$C; - descriptor s$J_1$B$C$D$$$outer ()Ls/J_1$B$C; - descriptor <init> (Ls/J_1$B$C;)V - -file s/J_1$B$C.class -class s.J_1$B$C extends java.lang.Object - inner B s.J_1$B in s.J_1 - inner/enclosing C enclosing class: s.J_1$B - inner/nested D member class: s.J_1$B$C$D - descriptor $outer Ls/J_1$B; - descriptor s$J_1$B$C$$$outer ()Ls/J_1$B; - descriptor <init> (Ls/J_1$B;)V - -file s/J_1$B.class -class s.J_1$B extends java.lang.Object - inner/enclosing B enclosing class: s.J_1 - inner/nested C member class: s.J_1$B$C - descriptor $outer Ls/J_1; - descriptor s$J_1$B$$$outer ()Ls/J_1; - descriptor <init> (Ls/J_1;)V - -file s/J_1.class -class s.J_1 extends java.lang.Object - interface java.util.RandomAccess - inner/nested B member class: s.J_1$B - descriptor <init> ()V - diff --git a/test/files/run/inner-parse/J_1.java b/test/files/run/inner-parse/J_1.java deleted file mode 100644 index 920ab951ab..0000000000 --- a/test/files/run/inner-parse/J_1.java +++ /dev/null @@ -1,9 +0,0 @@ -package j; - -public class J_1 implements java.util.RandomAccess { // "random" marker interface - class B { - class C { - class D { } - } - } -} diff --git a/test/files/run/inner-parse/S_2.scala b/test/files/run/inner-parse/S_2.scala deleted file mode 100644 index fd144a40b7..0000000000 --- a/test/files/run/inner-parse/S_2.scala +++ /dev/null @@ -1,9 +0,0 @@ -package s; - -class J_1 extends java.util.RandomAccess { - class B { - class C { - class D { } - } - } -} diff --git a/test/files/run/inner-parse/S_3.scala b/test/files/run/inner-parse/S_3.scala deleted file mode 100644 index aaa6a6ad35..0000000000 --- a/test/files/run/inner-parse/S_3.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.reflect.internal.JvmClassInfo - -object Test { - def main(args: Array[String]): Unit = { - val cwd = sys.props("partest.output") - - for ((f, info) <- JvmClassInfo.classInfoList(cwd)) { - println("file " + f.stripPrefix(cwd).substring(1).replace('\\', '/')) - println(info) - } - } -} diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check index 7d14da243b..d1cc754f2c 100644 --- a/test/files/run/lazy-locals.check +++ b/test/files/run/lazy-locals.check @@ -36,30 +36,19 @@ forced lazy val t02 forced lazy val t01 forced lazy val t00 Sum is: 496 -forced lazy val t32 -forced lazy val t31 -forced lazy val t30 -forced lazy val t29 -forced lazy val t28 -forced lazy val t27 -forced lazy val t26 -forced lazy val t25 -forced lazy val t24 -forced lazy val t23 -forced lazy val t22 -forced lazy val t21 -forced lazy val t20 -forced lazy val t19 -forced lazy val t18 -forced lazy val t17 -forced lazy val t16 -forced lazy val t15 -forced lazy val t14 -forced lazy val t13 -forced lazy val t12 -forced lazy val t11 -forced lazy val t10 -forced lazy val t09 +Sum again is: 496 +Sum again again is: 496 +forced lazy val t07 +forced lazy val t06 +forced lazy val t05 +forced lazy val t04 +forced lazy val t03 +forced lazy val t02 +forced lazy val t01 +forced lazy val t00 +Sum is: 28 +Sum again is: 28 +Sum again again is: 28 forced lazy val t08 forced lazy val t07 forced lazy val t06 @@ -69,7 +58,9 @@ forced lazy val t03 forced lazy val t02 forced lazy val t01 forced lazy val t00 -Sum is: 528 +Sum is: 36 +Sum again is: 36 +Sum again again is: 36 forced lazy val t at n = 0 42 forced lazy val t at n = 0 diff --git a/test/files/run/lazy-locals.scala b/test/files/run/lazy-locals.scala index 696aeeba96..aca15d0357 100644 --- a/test/files/run/lazy-locals.scala +++ b/test/files/run/lazy-locals.scala @@ -13,7 +13,7 @@ object Test extends App { 1 + t + t } - /** test 32 lazy vals, which fills one bitmap int. */ + /** test 32 lazy vals, which should spill over multiple byte bitmaps. */ def testLazy32 = { lazy val t00 = { Console.println("forced lazy val t00"); 0 } lazy val t01 = { Console.println("forced lazy val t01"); 1 } @@ -51,12 +51,25 @@ object Test extends App { val sum = t31 + t30 + t29 + t28 + t27 + t26 + t25 + t24 + t23 + t22 + t21 + t20 + t19 + t18 + t17 + t16 + t15 + t14 + t13 + t12 + t11 + t10 + t09 + t08 + t07 + t06 + t05 + - t04 + t03 + t02 + t01 + t00; - println("Sum is: " + sum); + t04 + t03 + t02 + t01 + t00 + val sum2 = t31 + t30 + t29 + t28 + t27 + t26 + t25 + t24 + t23 + + t22 + t21 + t20 + t19 + t18 + t17 + t16 + t15 + t14 + + t13 + t12 + t11 + t10 + t09 + t08 + t07 + t06 + t05 + + t04 + t03 + t02 + t01 + t00 + val sum3 = t00 + t01 + t02 + t03 + t04 + t05 + t06 + t07 + t08 + + t09 + t10 + t11 + t12 + t13 + t14 + t15 + t16 + t17 + + t18 + t19 + t20 + t21 + t22 + t23 + t24 + t25 + t26 + + t27 + t28 + t29 + t30 + t31 + + + + println("Sum is: " + sum) + println("Sum again is: " + sum2) + println("Sum again again is: " + sum3) } - /** test 32 lazy vals, which needs two bitmap ints. */ - def testLazy33 = { + /** test 8 lazy vals, which should fit one byte bitmap. */ + def testLazy8 = { lazy val t00 = { Console.println("forced lazy val t00"); 0 } lazy val t01 = { Console.println("forced lazy val t01"); 1 } lazy val t02 = { Console.println("forced lazy val t02"); 2 } @@ -65,39 +78,38 @@ object Test extends App { lazy val t05 = { Console.println("forced lazy val t05"); 5 } lazy val t06 = { Console.println("forced lazy val t06"); 6 } lazy val t07 = { Console.println("forced lazy val t07"); 7 } - lazy val t08 = { Console.println("forced lazy val t08"); 8 } - lazy val t09 = { Console.println("forced lazy val t09"); 9 } - lazy val t10 = { Console.println("forced lazy val t10"); 10 } - lazy val t11 = { Console.println("forced lazy val t11"); 11 } - lazy val t12 = { Console.println("forced lazy val t12"); 12 } - lazy val t13 = { Console.println("forced lazy val t13"); 13 } - lazy val t14 = { Console.println("forced lazy val t14"); 14 } - lazy val t15 = { Console.println("forced lazy val t15"); 15 } - lazy val t16 = { Console.println("forced lazy val t16"); 16 } - lazy val t17 = { Console.println("forced lazy val t17"); 17 } - lazy val t18 = { Console.println("forced lazy val t18"); 18 } - lazy val t19 = { Console.println("forced lazy val t19"); 19 } - lazy val t20 = { Console.println("forced lazy val t20"); 20 } - lazy val t21 = { Console.println("forced lazy val t21"); 21 } - lazy val t22 = { Console.println("forced lazy val t22"); 22 } - lazy val t23 = { Console.println("forced lazy val t23"); 23 } - lazy val t24 = { Console.println("forced lazy val t24"); 24 } - lazy val t25 = { Console.println("forced lazy val t25"); 25 } - lazy val t26 = { Console.println("forced lazy val t26"); 26 } - lazy val t27 = { Console.println("forced lazy val t27"); 27 } - lazy val t28 = { Console.println("forced lazy val t28"); 28 } - lazy val t29 = { Console.println("forced lazy val t29"); 29 } - lazy val t30 = { Console.println("forced lazy val t30"); 30 } - lazy val t31 = { Console.println("forced lazy val t31"); 31 } - lazy val t32 = { Console.println("forced lazy val t32"); 32 } - val sum = t32 + t31 + t30 + t29 + t28 + t27 + t26 + t25 + t24 + t23 + - t22 + t21 + t20 + t19 + t18 + t17 + t16 + t15 + t14 + - t13 + t12 + t11 + t10 + t09 + t08 + t07 + t06 + t05 + - t04 + t03 + t02 + t01 + t00; - println("Sum is: " + sum); + val sum = t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum2 = t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum3 = t00 + t01 + t02 + t03 + t04 + t05 + t06 + t07 + + + + println("Sum is: " + sum) + println("Sum again is: " + sum2) + println("Sum again again is: " + sum3) } + /** test 9 lazy vals, which should spill over two bitmaps. */ + def testLazy9 = { + lazy val t00 = { Console.println("forced lazy val t00"); 0 } + lazy val t01 = { Console.println("forced lazy val t01"); 1 } + lazy val t02 = { Console.println("forced lazy val t02"); 2 } + lazy val t03 = { Console.println("forced lazy val t03"); 3 } + lazy val t04 = { Console.println("forced lazy val t04"); 4 } + lazy val t05 = { Console.println("forced lazy val t05"); 5 } + lazy val t06 = { Console.println("forced lazy val t06"); 6 } + lazy val t07 = { Console.println("forced lazy val t07"); 7 } + lazy val t08 = { Console.println("forced lazy val t08"); 8 } + + val sum = t08 + t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum2 = t08 + t07 + t06 + t05 + t04 + t03 + t02 + t01 + t00 + val sum3 = t00 + t01 + t02 + t03 + t04 + t05 + t06 + t07 + t08 + + println("Sum is: " + sum) + println("Sum again is: " + sum2) + println("Sum again again is: " + sum3) + } /** test recursive method with lazy vals and a single forced */ def testLazyRec(n: Int): Int = { @@ -185,7 +197,8 @@ object Test extends App { println(testLazy) testLazy32 - testLazy33 + testLazy8 + testLazy9 println(testLazyRec(5)) println(testLazyRecMany(5)) testRecVal diff --git a/test/files/run/mock.check b/test/files/run/mock.check deleted file mode 100644 index 967c4e20bb..0000000000 --- a/test/files/run/mock.check +++ /dev/null @@ -1,3 +0,0 @@ -Hi, thanks for calling: that makes 1 times. -Hi, thanks for calling: that makes 2 times. -Hi, thanks for calling: that makes 3 times. diff --git a/test/files/run/mock.scala b/test/files/run/mock.scala deleted file mode 100644 index 8778e20ef5..0000000000 --- a/test/files/run/mock.scala +++ /dev/null @@ -1,29 +0,0 @@ -import scala.tools.reflect._ -import java.util.concurrent.Callable -import java.io.Closeable - -object Test { - // It'd be really nice about now if functions had a common parent. - implicit def interfaceify(x: AnyRef): UniversalFn = UniversalFn(x) - - def runner(x: Runnable) = x.run() - def caller[T](x: Callable[T]): T = x.call() - def closer(x: Closeable) = x.close() - - def main(args: Array[String]): Unit = { - var counter = 0 - val closure = () => { - counter += 1 - println("Hi, thanks for calling: that makes " + counter + " times.") - counter - } - - val int1 = closure.as[Runnable] - val int2 = closure.as[Callable[Int]] - val int3 = closure.as[Closeable] - - runner(int1) - caller(int2) - closer(int3) - } -} diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check index 5656d1a276..f253de71d6 100644 --- a/test/files/run/names-defaults.check +++ b/test/files/run/names-defaults.check @@ -92,7 +92,7 @@ test5 test5 5 10: 2 -slkdfj1 +slkdfj2 1 lskfdjlk 11 diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala index e1bc7cbf59..220414f02a 100644 --- a/test/files/run/names-defaults.scala +++ b/test/files/run/names-defaults.scala @@ -176,7 +176,7 @@ object Test extends App { println(Fact2()("jyp")) println(Fact2(x = 1)()) - println(Fact2(10)().copy(y = "blabla")()) + println(Fact2(10)().copy(y = "blabla")(3)) // assignment to var <-> named argument @@ -195,7 +195,7 @@ object Test extends App { // dependent types and copy method val a11 = new A2 val b11 = a11.B2(new a11.C2)(1) - println(b11.copy()()) + println(b11.copy()(2)) diff --git a/test/files/run/patmat_unapp_abstype-new.check b/test/files/run/patmat_unapp_abstype-new.check index 72239d16cd..42c54631d2 100644 --- a/test/files/run/patmat_unapp_abstype-new.check +++ b/test/files/run/patmat_unapp_abstype-new.check @@ -1,4 +1,4 @@ TypeRef -none of the above +MethodType Bar Foo diff --git a/test/files/run/patmat_unapp_abstype-new.flags b/test/files/run/patmat_unapp_abstype-new.flags deleted file mode 100644 index ba80cad69b..0000000000 --- a/test/files/run/patmat_unapp_abstype-new.flags +++ /dev/null @@ -1 +0,0 @@ --Xoldpatmat diff --git a/test/files/run/repl-backticks.scala b/test/files/run/repl-backticks.scala index 11c58e18a1..5eaa1ec4c1 100644 --- a/test/files/run/repl-backticks.scala +++ b/test/files/run/repl-backticks.scala @@ -11,7 +11,7 @@ object Test { def main(args: Array[String]) = { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") - val repl = new Interpreter(settings) + val repl = new interpreter.IMain(settings) repl.interpret(testCode) } } diff --git a/test/files/run/repl-exceptions.check b/test/files/run/repl-exceptions.check deleted file mode 100644 index f7ce018422..0000000000 --- a/test/files/run/repl-exceptions.check +++ /dev/null @@ -1,25 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> - -scala> sys.SystemProperties.traceSourcePath setValue "" -res0: String = null - -scala> def f = sys.error("hi mom") -f: Nothing - -scala> f -[package.error] (package.scala:27) -(access lastException for the full trace) - -scala> lastException.show -/* The repl internal portion of the stack trace is elided. */ -[package.error] (package.scala:27) -[.f] (<console>:7) -[.<init>] (<console>:9) -[.<clinit>] (<console>:-1) - -scala> - -scala> diff --git a/test/files/run/repl-exceptions.scala b/test/files/run/repl-exceptions.scala deleted file mode 100644 index bccedeba6b..0000000000 --- a/test/files/run/repl-exceptions.scala +++ /dev/null @@ -1,13 +0,0 @@ -import scala.tools.partest.ReplTest -import scala.tools.util.Javap - -// This test blows up under -Yrepl-sync. -object Test extends ReplTest { - override def extraSettings = "-Yrich-exceptions" - def code = """ - |sys.SystemProperties.traceSourcePath setValue "" - |def f = sys.error("hi mom") - |f - |lastException.show - """.stripMargin -} diff --git a/test/files/run/repl-suppressed-warnings.check b/test/files/run/repl-suppressed-warnings.check deleted file mode 100644 index ef9e5c1270..0000000000 --- a/test/files/run/repl-suppressed-warnings.check +++ /dev/null @@ -1,65 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> - -scala> - -scala> // "Is this thing on?" Not working on first couple - -scala> // commands, needs investigation. - -scala> 123 -res0: Int = 123 - -scala> 123 -res1: Int = 123 - -scala> 123 -res2: Int = 123 - -scala> - -scala> object o { - case class Bippy() - case class Dingus { - def f[T](xs: TraversableOnce[T]) = xs match { - case _: List[Int] => 1 - case _: Set[String] => 2 - case _ => xs.isInstanceOf[Iterator[Double]] - } - } - case class DingDangDoobie(ding: Int, dang: Int, doobie: Double) - case class Dongoo - @serializable case class Heyooooo - - @deprecated("I'm an ironic deprecation warning") def f0 = 5 // where's this disappearing? - def f1 = Double.Epsilon // and this? -} -warning: there were 6 deprecation warnings; re-run with -deprecation for details -warning: there were 3 unchecked warnings; re-run with -unchecked for details -defined module o - -scala> - -scala> :warnings -<console>:3: warning: case classes without a parameter list have been deprecated; -use either case objects or case classes with `()' as parameter list. - case class Dingus { - ^ -<console>:11: warning: case classes without a parameter list have been deprecated; -use either case objects or case classes with `()' as parameter list. - case class Dongoo - ^ -<console>:11: warning: case classes without a parameter list have been deprecated; -use either case objects or case classes with `()' as parameter list. - case class Dongoo - ^ -<console>:12: warning: case classes without a parameter list have been deprecated; -use either case objects or case classes with `()' as parameter list. - @serializable case class Heyooooo - ^ - -scala> - -scala> diff --git a/test/files/run/repl-suppressed-warnings.scala b/test/files/run/repl-suppressed-warnings.scala deleted file mode 100644 index 1a51afe34f..0000000000 --- a/test/files/run/repl-suppressed-warnings.scala +++ /dev/null @@ -1,32 +0,0 @@ -import scala.tools.partest.ReplTest - -object Test extends ReplTest { - override def extraSettings = "" - def code = """ - -// "Is this thing on?" Not working on first couple -// commands, needs investigation. -123 -123 -123 - -object o { - case class Bippy() - case class Dingus { - def f[T](xs: TraversableOnce[T]) = xs match { - case _: List[Int] => 1 - case _: Set[String] => 2 - case _ => xs.isInstanceOf[Iterator[Double]] - } - } - case class DingDangDoobie(ding: Int, dang: Int, doobie: Double) - case class Dongoo - @serializable case class Heyooooo - - @deprecated("I'm an ironic deprecation warning") def f0 = 5 // where's this disappearing? - def f1 = Double.Epsilon // and this? -} - -:warnings - """ -} diff --git a/test/files/run/t1247.check b/test/files/run/t1247.check new file mode 100644 index 0000000000..ce123032fd --- /dev/null +++ b/test/files/run/t1247.check @@ -0,0 +1 @@ +Is same closure class: true is same closure: true diff --git a/test/files/run/t1247.scala b/test/files/run/t1247.scala new file mode 100644 index 0000000000..c709b73bc8 --- /dev/null +++ b/test/files/run/t1247.scala @@ -0,0 +1,11 @@ +object Test extends App { + val f = () => 5 + def test(g: => Int) { + val gFunc = g _ + val isSameClosureClass = gFunc.getClass == f.getClass + val isSame = gFunc eq f + println("Is same closure class: "+isSameClosureClass+" is same closure: "+isSame) + } + + test(f()) +} diff --git a/test/files/run/t1500.scala b/test/files/run/t1500.scala index 586a2666ad..ab132b724f 100644 --- a/test/files/run/t1500.scala +++ b/test/files/run/t1500.scala @@ -1,4 +1,4 @@ -import scala.tools.nsc._ +import scala.tools.nsc._ object Test { @@ -20,7 +20,7 @@ object Test { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") - val tool = new Interpreter(settings) + val tool = new interpreter.IMain(settings) val global = tool.compiler import global._ diff --git a/test/files/run/t1501.scala b/test/files/run/t1501.scala index dee6e0c68e..aba206bc7a 100644 --- a/test/files/run/t1501.scala +++ b/test/files/run/t1501.scala @@ -30,7 +30,7 @@ object Test { def main(args: Array[String]) = { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") - val tool = new Interpreter(settings) + val tool = new interpreter.IMain(settings) val global = tool.compiler import global._ diff --git a/test/files/run/t2296c.check b/test/files/run/t2296c.check new file mode 100644 index 0000000000..076e9180a8 --- /dev/null +++ b/test/files/run/t2296c.check @@ -0,0 +1 @@ +RUNNING ACTION diff --git a/test/files/run/t2296c/Action.java b/test/files/run/t2296c/Action.java new file mode 100644 index 0000000000..50ba9a4de1 --- /dev/null +++ b/test/files/run/t2296c/Action.java @@ -0,0 +1,21 @@ +package bug.action; + +import bug.Global; + +public abstract class Action { + protected Global m_glob; + + public Action(Global glob0) { + m_glob = glob0; + } + + public Action() { + this(null); + } + + public abstract void run(int v); + + public void setGlobal(Global g) { + m_glob = g; + } +} diff --git a/test/files/run/t2296c/Display.java b/test/files/run/t2296c/Display.java new file mode 100644 index 0000000000..7f7e6a73d0 --- /dev/null +++ b/test/files/run/t2296c/Display.java @@ -0,0 +1,9 @@ +package bug; + +public class Display { + protected Global m_glob; + + public void start() { + m_glob.runActions(); + } +} diff --git a/test/files/run/t2296c/Global.java b/test/files/run/t2296c/Global.java new file mode 100644 index 0000000000..7e5a762de2 --- /dev/null +++ b/test/files/run/t2296c/Global.java @@ -0,0 +1,29 @@ +package bug; + +import bug.action.Action; +import java.util.List; +import java.util.LinkedList; + +public class Global { + public int items() { + return 0; + } + + public int items(int i) { + return i + ls.size(); + } + + private List<Action> ls = new LinkedList<Action>(); + + public void putAction(Action a) { + a.setGlobal(this); + ls.add(a); + } + + public void runActions() { + for (Action action: ls) { + System.out.println("RUNNING ACTION"); + action.run(0); + } + } +} diff --git a/test/files/run/t2296c/ScalaActivity.scala b/test/files/run/t2296c/ScalaActivity.scala new file mode 100644 index 0000000000..aa7648a944 --- /dev/null +++ b/test/files/run/t2296c/ScalaActivity.scala @@ -0,0 +1,18 @@ +package test + +import bug.Display +import bug.action.Action + +abstract class Outer extends Display { + + def init() { + m_glob.putAction(ScalaActivity) + } + + object ScalaActivity extends Action { + def run(v: Int) { + val testSet = List(1,2,3) + testSet.map(p => m_glob.items(p)) // crash with illegal access + } + } +} diff --git a/test/files/run/t2296c/Test.scala b/test/files/run/t2296c/Test.scala new file mode 100644 index 0000000000..1132bebebb --- /dev/null +++ b/test/files/run/t2296c/Test.scala @@ -0,0 +1,15 @@ +package test + +import bug.Global + +object Test { + def main(args: Array[String]) { + val m = new Main() + m.init() + m.start() + } +} + +class Main extends Outer { + m_glob = new Global() +} diff --git a/test/files/run/t2296c/a.scala b/test/files/run/t2296c/a.scala new file mode 100644 index 0000000000..fae32f4ec4 --- /dev/null +++ b/test/files/run/t2296c/a.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + test.Test main args + } +} diff --git a/test/files/run/t2488.check b/test/files/run/t2488.check new file mode 100644 index 0000000000..1af4bf8965 --- /dev/null +++ b/test/files/run/t2488.check @@ -0,0 +1,4 @@ +1 +1 +1 +2 diff --git a/test/files/run/t2488.scala b/test/files/run/t2488.scala new file mode 100644 index 0000000000..22abdf8af2 --- /dev/null +++ b/test/files/run/t2488.scala @@ -0,0 +1,11 @@ +class C { + def f(a:Int, b:Int) = 1 + def f() = 2 +} +object Test extends App { + val c = new C() + println(c.f(a = 1,2)) + println(c.f(a = 1, b = 2)) + println(c.f(b = 2, a = 1)) + println(c.f()) +} diff --git a/test/files/run/t3488.check b/test/files/run/t3488.check new file mode 100644 index 0000000000..0d66ea1aee --- /dev/null +++ b/test/files/run/t3488.check @@ -0,0 +1,2 @@ +0 +1 diff --git a/test/files/run/t3488.scala b/test/files/run/t3488.scala new file mode 100644 index 0000000000..20a1400dce --- /dev/null +++ b/test/files/run/t3488.scala @@ -0,0 +1,6 @@ +object Test extends App { + def foo(p: => Unit)(x:Int = 0) = x + + println(foo { val List(_*)=List(0); 1 } ()) + println(foo { val List(_*)=List(0); 1 } (1)) +} diff --git a/test/files/run/t3569.check b/test/files/run/t3569.check index c73fce419a..a9fb5ff32e 100644 --- a/test/files/run/t3569.check +++ b/test/files/run/t3569.check @@ -9,8 +9,7 @@ private int Test$X.var1 private int Test$X.var2 private int Test$X.var3 private int Test$X.x -private volatile int Test$X.bitmap$priv$0 -public volatile int Test$X.bitmap$0 +private volatile byte Test$X.bitmap$0 private final int Test$Y.z1 private final int Test$Y.z2 private int Test$Y.x diff --git a/test/files/run/t3702.check b/test/files/run/t3702.check new file mode 100644 index 0000000000..31c2ac4ed1 --- /dev/null +++ b/test/files/run/t3702.check @@ -0,0 +1,2 @@ +() +6 diff --git a/test/files/run/t3702.scala b/test/files/run/t3702.scala new file mode 100644 index 0000000000..021abcb625 --- /dev/null +++ b/test/files/run/t3702.scala @@ -0,0 +1,11 @@ +object Test { + def foo(h: Any, t: List[Any]) = h match { + case 5 :: _ => () + case List(from) => from + } + + def main(args: Array[String]): Unit = { + println(foo(5 :: Nil, List(1,2,3))) + println(foo(6 :: Nil, List(1,2,3))) + } +} diff --git a/test/files/run/t3798.check b/test/files/run/t3798.check new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/test/files/run/t3798.check @@ -0,0 +1 @@ +true diff --git a/test/files/run/t3798.scala b/test/files/run/t3798.scala new file mode 100644 index 0000000000..3ede57bee7 --- /dev/null +++ b/test/files/run/t3798.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]) { + val seq: MySeq[Undefined] = new MySeq[Floats](new Array[Float](10)) + println(10 == seq.array.length) + } +} + +sealed trait Undefined { type ArrayType <: Array[_] } +sealed trait Floats extends Undefined { type ArrayType = Array[Float] } +class MySeq[+T <: Undefined](val array: T#ArrayType) diff --git a/test/files/run/t4025.check b/test/files/run/t4025.check new file mode 100644 index 0000000000..6715003cb6 --- /dev/null +++ b/test/files/run/t4025.check @@ -0,0 +1,19 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> class Color(val red: Int) +defined class Color + +scala> + +scala> case class Red(r:Int) extends Color(r) +defined class Red + +scala> + +scala> def f(c: Any) = c match { case Red(_) => () } +f: (c: Any)Unit + +scala> diff --git a/test/files/run/t4025.scala b/test/files/run/t4025.scala new file mode 100644 index 0000000000..5db0093970 --- /dev/null +++ b/test/files/run/t4025.scala @@ -0,0 +1,12 @@ +import scala.tools.nsc.Settings +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ +class Color(val red: Int) + +case class Red(r:Int) extends Color(r) + +def f(c: Any) = c match { case Red(_) => () } +""" +} diff --git a/test/files/run/t4124.check b/test/files/run/t4124.check new file mode 100644 index 0000000000..66a0092d93 --- /dev/null +++ b/test/files/run/t4124.check @@ -0,0 +1,4 @@ +hi +hi +bye +bye diff --git a/test/files/run/t4124.scala b/test/files/run/t4124.scala new file mode 100644 index 0000000000..9f35b57ce3 --- /dev/null +++ b/test/files/run/t4124.scala @@ -0,0 +1,24 @@ +import xml.Node + +object Test extends App { + val body: Node = <elem>hi</elem> + println ((body: AnyRef, "foo") match { + case (node: Node, "bar") => "bye" + case (ser: Serializable, "foo") => "hi" + }) + + println ((body, "foo") match { + case (node: Node, "bar") => "bye" + case (ser: Serializable, "foo") => "hi" + }) + + println ((body: AnyRef, "foo") match { + case (node: Node, "foo") => "bye" + case (ser: Serializable, "foo") => "hi" + }) + + println ((body: AnyRef, "foo") match { + case (node: Node, "foo") => "bye" + case (ser: Serializable, "foo") => "hi" + }) +} diff --git a/test/files/run/t4138.check b/test/files/run/t4138.check new file mode 100644 index 0000000000..f561b5e6b0 --- /dev/null +++ b/test/files/run/t4138.check @@ -0,0 +1,2 @@ +[1.45] parsed: "lir 'de\' ' \\ \n / upa \"new\" \t parsing" +[1.5] parsed: "s " diff --git a/test/files/run/t4138.scala b/test/files/run/t4138.scala new file mode 100644 index 0000000000..131489e581 --- /dev/null +++ b/test/files/run/t4138.scala @@ -0,0 +1,6 @@ +object Test extends App { + object p extends scala.util.parsing.combinator.JavaTokenParsers + + println(p.parse(p.stringLiteral, """"lir 'de\' ' \\ \n / upa \"new\" \t parsing"""")) + println(p.parse(p.stringLiteral, """"s " lkjse"""")) +} diff --git a/test/files/run/t4190.check b/test/files/run/t4190.check new file mode 100644 index 0000000000..b8aae0c7a1 --- /dev/null +++ b/test/files/run/t4190.check @@ -0,0 +1,3 @@ +a0 +b0 +c0 diff --git a/test/files/run/t4190.scala b/test/files/run/t4190.scala new file mode 100644 index 0000000000..aa88b8708d --- /dev/null +++ b/test/files/run/t4190.scala @@ -0,0 +1,6 @@ +import collection.mutable._ + +object Test extends App { + val x: ArrayBuffer[String] = ArrayBuffer("a", "b", "c") + x.view map (_ + "0") foreach println +} diff --git a/test/files/run/t4461.check b/test/files/run/t4461.check index b05c7b5589..e9c01e769d 100644 --- a/test/files/run/t4461.check +++ b/test/files/run/t4461.check @@ -4,4 +4,8 @@ Include(End,3) Include(End,4) Include(End,5) Include(End,6) -Include(End,7)
\ No newline at end of file +Include(End,7) +Script([1] Include(Index(7),8), [2] Include(Index(8),9), [3] Include(Index(9),10)) +Include(Start,0) +Script([1] Include(Index(0),-2), [2] Include(Index(1),-1)) +Remove(Index(0),-2)
\ No newline at end of file diff --git a/test/files/run/t4461.scala b/test/files/run/t4461.scala index 99da122f6b..adc9201313 100644 --- a/test/files/run/t4461.scala +++ b/test/files/run/t4461.scala @@ -15,5 +15,9 @@ object Test { buf ++= ArrayBuffer(3, 4) // works buf ++= List(5) // works buf ++= collection.immutable.Vector(6, 7) // works + buf.insertAll(7, List(8, 9, 10)) + 0 +=: buf + List(-2, -1) ++=: buf + buf remove 0 } } diff --git a/test/files/run/t4482.check b/test/files/run/t4482.check new file mode 100644 index 0000000000..0cfbf08886 --- /dev/null +++ b/test/files/run/t4482.check @@ -0,0 +1 @@ +2 diff --git a/test/files/run/t4482.scala b/test/files/run/t4482.scala new file mode 100644 index 0000000000..392861c22e --- /dev/null +++ b/test/files/run/t4482.scala @@ -0,0 +1,15 @@ +trait Foo { def i: Int } +trait Bar + +case class Spam(i: Int) extends Foo with Bar + +object Test { + def matchParent(p:Any) = p match { + case f:Foo if f.i == 1 => 1 + case _:Bar => 2 + case _:Foo => 3 + } + def main(args: Array[String]): Unit = { + println(matchParent(Spam(3))) + } +} diff --git a/test/files/run/t5009.check b/test/files/run/t5009.check new file mode 100644 index 0000000000..cc9df54b34 --- /dev/null +++ b/test/files/run/t5009.check @@ -0,0 +1,4 @@ +C(1,true) +10 +C(7283,20) +100 diff --git a/test/files/run/t5009.scala b/test/files/run/t5009.scala new file mode 100644 index 0000000000..b4fe1bc894 --- /dev/null +++ b/test/files/run/t5009.scala @@ -0,0 +1,17 @@ +object Test extends App { + + case class C[T, U <: String, O >: Object](x: Int, y: T)(z: U, b: Boolean)(s: O, val l: Int) + + val c = C(1, true)("dlkfj", true)("dlkfjlk", 10) + println(c) + println(c.l) + + val f1a = c.copy(y = 20, x = 7283) + + val f1b = c.copy[Int, String, Object](y = 20, x = 7283) + val f2b = f1b("lkdjen", false) + val res = f2b(new Object, 100) + println(res) + println(res.l) + +} diff --git a/test/files/run/t5037.check b/test/files/run/t5037.check new file mode 100644 index 0000000000..da29283aaa --- /dev/null +++ b/test/files/run/t5037.check @@ -0,0 +1,2 @@ +true +false diff --git a/test/files/run/t5037.scala b/test/files/run/t5037.scala new file mode 100644 index 0000000000..7b1fce7a82 --- /dev/null +++ b/test/files/run/t5037.scala @@ -0,0 +1,18 @@ +object Test { + def main(args: Array[String]) { + val t = new Test + t.inner.foo() + } +} + +class Test { + class Inner { + def foo() { + println(bar) + bar = false + println(bar) + } + } + val inner = new Inner + private[this] final var bar = true +} diff --git a/test/files/run/t5125.check b/test/files/run/t5125.check new file mode 100644 index 0000000000..d8a0565005 --- /dev/null +++ b/test/files/run/t5125.check @@ -0,0 +1,4 @@ +public void O1$.f(java.lang.String[]) +public void O1$.f(scala.collection.Seq) +public void O2$.f(java.lang.String[]) +public void O2$.f(scala.collection.Seq) diff --git a/test/files/run/t5125.scala b/test/files/run/t5125.scala new file mode 100644 index 0000000000..7ec2b929d9 --- /dev/null +++ b/test/files/run/t5125.scala @@ -0,0 +1,24 @@ +object O1 { + def instance = this + @scala.annotation.varargs + def f(values:String*) = println("Calling O1.f(): " + values) +} + +object O2 { + def instance = this + @scala.annotation.varargs + def f(values:String*) = println("Calling O2.f(): " + values) + // uncommenting g() results in errors in A.java + def g(): String => Int = s => s.hashCode +} + +object Test extends App { + def check(c: Class[_]) { + val methodName = "f" + val methods = c.getDeclaredMethods.filter(_.getName == methodName) + println(methods.map(_.toString).sorted.mkString("\n")) + } + + check(O1.getClass) + check(O2.getClass) +}
\ No newline at end of file diff --git a/test/files/run/t5125b.check b/test/files/run/t5125b.check new file mode 100644 index 0000000000..ddbf908f04 --- /dev/null +++ b/test/files/run/t5125b.check @@ -0,0 +1,7 @@ +public void C1.f(java.lang.String[]) +public void C1.f(scala.collection.Seq) +public void C2.f(java.lang.String[]) +public void C2.f(scala.collection.Seq) +public void C2$C3.f(java.lang.String[]) +public void C2$C3.f(scala.collection.Seq) +public void C4.f(scala.collection.Seq) diff --git a/test/files/run/t5125b.scala b/test/files/run/t5125b.scala new file mode 100644 index 0000000000..29c08fee4c --- /dev/null +++ b/test/files/run/t5125b.scala @@ -0,0 +1,37 @@ +class C1 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C1.f(): " + values) +} + +class C2 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C2.f(): " + values) + def g(): String => Int = s => s.hashCode + + class C3 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C3.f(): " + values) + } +} + +class C4 { + def f(values: String*) = println("Calling C4.f(): " + values) + + locally { + @scala.annotation.varargs + def f(values: String*) = println("Calling C4.<locally>.f(): " + values) + } +} + +object Test extends App { + def check(c: Class[_]) { + val methodName = "f" + val methods = c.getDeclaredMethods.filter(_.getName == methodName) + println(methods.map(_.toString).sorted.mkString("\n")) + } + + check(classOf[C1]) + check(classOf[C2]) + check(classOf[C2#C3]) + check(classOf[C4]) +} diff --git a/test/files/run/t5201.check b/test/files/run/t5201.check new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/test/files/run/t5201.check @@ -0,0 +1 @@ +true diff --git a/test/files/run/t5201.scala b/test/files/run/t5201.scala new file mode 100644 index 0000000000..48aa7ba54c --- /dev/null +++ b/test/files/run/t5201.scala @@ -0,0 +1,8 @@ +object Test extends App { + // First make sure specific types are preserved + val tmp: Vector[Int] = Vector(Vector(1,2), Vector(3,4)).view.flatten.force + + // Now make sure we really get a view + val seq = Seq(Seq(1, 2), Seq(3, 4)).view.flatten + Console.println(seq.isInstanceOf[collection.SeqView[_,_]]) +} diff --git a/test/files/run/t5328.check b/test/files/run/t5328.check new file mode 100644 index 0000000000..77a43968c5 --- /dev/null +++ b/test/files/run/t5328.check @@ -0,0 +1,3 @@ +2 +1,2,8 +1,8,3 diff --git a/test/files/run/t5328.scala b/test/files/run/t5328.scala new file mode 100644 index 0000000000..12adf45b84 --- /dev/null +++ b/test/files/run/t5328.scala @@ -0,0 +1,5 @@ +object Test extends App { + println(Vector(1).view.updated(0,2).toList mkString ",") + println(Seq(1,2,3).view.updated(2,8).toList mkString ",") + println(List(1,2,3).view.updated(1,8).toList mkString ",") +} diff --git a/test/files/run/t5394.scala b/test/files/run/t5394.scala new file mode 100644 index 0000000000..1b39da3ac4 --- /dev/null +++ b/test/files/run/t5394.scala @@ -0,0 +1,4 @@ +object Test extends App { + def f[T](l: List[T]): Int = l match { case x :: xs => f(xs) case Nil => 0 } + f(List.fill(10000)(0)) +}
\ No newline at end of file diff --git a/test/files/run/t5407.check b/test/files/run/t5407.check new file mode 100644 index 0000000000..51993f072d --- /dev/null +++ b/test/files/run/t5407.check @@ -0,0 +1,2 @@ +2 +2 diff --git a/test/files/run/t5407.scala b/test/files/run/t5407.scala new file mode 100644 index 0000000000..35a8ec6a45 --- /dev/null +++ b/test/files/run/t5407.scala @@ -0,0 +1,17 @@ +case class Foo(private val x: Int, y: Option[Int], z: Boolean) + +object Test extends App { + def foo(x: Foo) = x match { + case Foo(x, Some(y), z) => y + case Foo(x, y, z) => 0 + } + val x = Foo(1, Some(2), false) + println(foo(x)) + + + def bar(x: Foo) = x match { + case Foo(x, Some(y), z) => y + case Foo(x, None, z) => 0 + } + println(bar(x)) +}
\ No newline at end of file diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check index bb13928fd8..1518168c51 100644 --- a/test/files/run/t5527.check +++ b/test/files/run/t5527.check @@ -1,4 +1,4 @@ -[[syntax trees at end of parser]]// Scala source: newSource1 +[[syntax trees at end of parser]] // newSource1 package <empty> { object UselessComments extends scala.AnyRef { def <init>() = { diff --git a/test/files/run/t5544.check b/test/files/run/t5544.check new file mode 100644 index 0000000000..257cc5642c --- /dev/null +++ b/test/files/run/t5544.check @@ -0,0 +1 @@ +foo diff --git a/test/files/run/t5544/Api_1.scala b/test/files/run/t5544/Api_1.scala new file mode 100644 index 0000000000..b4c92864de --- /dev/null +++ b/test/files/run/t5544/Api_1.scala @@ -0,0 +1,8 @@ +import scala.annotation.StaticAnnotation + +class ann(val bar: Any) extends StaticAnnotation + +object Api { + @ann({def foo = "foo!!"}) + def foo = println("foo") +} diff --git a/test/files/run/t5544/Test_2.scala b/test/files/run/t5544/Test_2.scala new file mode 100644 index 0000000000..285f8959e0 --- /dev/null +++ b/test/files/run/t5544/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends App { + Api.foo +} diff --git a/test/files/run/t5552.check b/test/files/run/t5552.check new file mode 100644 index 0000000000..a19a60840e --- /dev/null +++ b/test/files/run/t5552.check @@ -0,0 +1,2 @@ +(3,3) +(3.0,3.0) diff --git a/test/files/run/t5552.scala b/test/files/run/t5552.scala new file mode 100644 index 0000000000..afb8a1f0be --- /dev/null +++ b/test/files/run/t5552.scala @@ -0,0 +1,10 @@ +class C[@specialized(Int) A](a:A) { + lazy val b = (a, a) + def c = b +} +object Test { + def main(args:Array[String]) { + println(new C(3).c) + println(new C(3.0).c) + } +} diff --git a/test/files/run/t5610.check b/test/files/run/t5610.check new file mode 100644 index 0000000000..023f18d8f1 --- /dev/null +++ b/test/files/run/t5610.check @@ -0,0 +1,6 @@ +some string +some string +some string +some string +List(2, 3) +List(5, 6) diff --git a/test/files/run/t5610.scala b/test/files/run/t5610.scala new file mode 100644 index 0000000000..f62b2df6b4 --- /dev/null +++ b/test/files/run/t5610.scala @@ -0,0 +1,30 @@ +object Test { + def main(args: Array[String]): Unit = { + var test: String = null + val fun1: Int => () => Unit = foo(test) _ + val fun2: Int => () => Unit = foo(test)(_) + val fun3: Int => () => Unit = { + lazy val eta1: String = test + (dummy: Int) => foo(eta1)(dummy) + } + val fun4: Int => () => Unit = { + val eta1: () => String = () => test + (dummy: Int) => foo(eta1())(dummy) + } + test = "some string" + fun1(1)() + fun2(1)() + fun3(1)() + fun4(1)() + + val f: (String, Int*) => Unit = m(2, 3) + f("", 5, 6) + } + + def foo(s: => String)(dummy: Int) = () => println(s) + + def m(a: Int*)(z: String, b: Int*) { + println(a.toList) + println(b.toList) + } +} diff --git a/test/files/run/t5629.check b/test/files/run/t5629.check new file mode 100644 index 0000000000..6a2d630f4e --- /dev/null +++ b/test/files/run/t5629.check @@ -0,0 +1,2 @@ +int child got: 33 +any child got: 33 diff --git a/test/files/run/t5629.scala b/test/files/run/t5629.scala new file mode 100644 index 0000000000..69feddd3a5 --- /dev/null +++ b/test/files/run/t5629.scala @@ -0,0 +1,36 @@ + + + +import scala.{specialized => spec} + + + +trait GrandParent[@spec(Int) -A] { + def foo(a: A): Unit + def bar[B <: A](b: B): Unit = println("grandparent got: %s" format b) +} + + +trait Parent[@spec(Int) -A] extends GrandParent[A] { + def foo(a: A) = bar(a) +} + + +class IntChild extends Parent[Int] { + override def bar[B <: Int](b: B): Unit = println("int child got: %s" format b) +} + + +class AnyChild extends Parent[Any] { + override def bar[B <: Any](b: B): Unit = println("any child got: %s" format b) +} + + +object Test { + + def main(args: Array[String]) { + new IntChild().foo(33) + new AnyChild().foo(33) + } + +} diff --git a/test/files/run/t5629b.check b/test/files/run/t5629b.check new file mode 100644 index 0000000000..1bc0248c3d --- /dev/null +++ b/test/files/run/t5629b.check @@ -0,0 +1,10 @@ +=== pf(1): +MySmartPF.apply entered... +newPF.applyOrElse entered... +default +scala.MatchError: () (of class scala.runtime.BoxedUnit) +=== pf(42): +MySmartPF.apply entered... +newPF.applyOrElse entered... +ok +=== done diff --git a/test/files/run/t5629b.scala b/test/files/run/t5629b.scala new file mode 100644 index 0000000000..6c908081b9 --- /dev/null +++ b/test/files/run/t5629b.scala @@ -0,0 +1,41 @@ + + + + + +object Test extends App { + + trait MyPF[@specialized(Int) -A] extends (A => Unit) { + def isDefinedAt(x: A): Boolean + def applyOrElse[A1 <: A](x: A1, default: A1 => Unit): Unit = { + println("MyPF.applyOrElse entered...") + if (isDefinedAt(x)) apply(x) else default(x) + } + } + + trait MySmartPF[@specialized(Int) -A] extends MyPF[A] { + def apply(x: A): Unit = { + println("MySmartPF.apply entered...") + applyOrElse(x, { _: Any => throw new MatchError }) + } + } + + type T = Int + //type T = Any + + def newPF(test: T): MyPF[T] = new MySmartPF[T] { + def isDefinedAt(x: T): Boolean = x != test + override def applyOrElse[A1 <: T](x: A1, default: A1 => Unit): Unit = { + println("newPF.applyOrElse entered...") + if (x != test) { println("ok"); () } else { println("default"); default(x) } + } + } + + val pf = newPF(1) + println("=== pf(1):") + try { pf(1) } catch { case x => println(x) } + println("=== pf(42):") + pf(42) + println("=== done") + +} diff --git a/test/files/run/t5676.check b/test/files/run/t5676.check new file mode 100644 index 0000000000..3b562d3046 --- /dev/null +++ b/test/files/run/t5676.check @@ -0,0 +1,3 @@ +ok +false +true diff --git a/test/pending/run/t5676.flags b/test/files/run/t5676.flags index e1b37447c9..e1b37447c9 100644 --- a/test/pending/run/t5676.flags +++ b/test/files/run/t5676.flags diff --git a/test/files/run/t5676.scala b/test/files/run/t5676.scala new file mode 100644 index 0000000000..b643c300ce --- /dev/null +++ b/test/files/run/t5676.scala @@ -0,0 +1,24 @@ +import java.lang.reflect.Modifier + +class Bar[T] + +class Foo[T] { + object A extends Bar[T] +} + +class Baz[S] extends Foo[S] { + override object A extends Bar[S] { + def foo(): String = "ok" + } +} + +object Test { + + def main(a: Array[String]) { + val b = new Baz[Any] + println(b.A.foo()) + println(Modifier.isFinal(classOf[Baz[Any]].getModifiers())) + println(Modifier.isFinal(Test.getClass.getModifiers())) + } + +} diff --git a/test/files/run/t5804.check b/test/files/run/t5804.check new file mode 100644 index 0000000000..3ccc1c24d3 --- /dev/null +++ b/test/files/run/t5804.check @@ -0,0 +1,4 @@ +128 +16 +128 +32
\ No newline at end of file diff --git a/test/files/run/t5804.scala b/test/files/run/t5804.scala new file mode 100644 index 0000000000..b96a736035 --- /dev/null +++ b/test/files/run/t5804.scala @@ -0,0 +1,32 @@ + + +import collection.mutable._ + + +object Test { + + def main(args: Array[String]) { + class CustomHashMap extends HashMap[Int, Int] { + override def initialSize = 65 + + println(table.length) + } + + new CustomHashMap + new HashMap { + println(table.length) + } + + class CustomHashSet extends HashSet[Int] { + override def initialSize = 96 + + println(table.length) + } + + new CustomHashSet + new HashSet { + println(table.length) + } + } + +} diff --git a/test/files/run/xml-loop-bug.scala b/test/files/run/xml-loop-bug.scala index 378ae9bc2b..67637674b2 100644 --- a/test/files/run/xml-loop-bug.scala +++ b/test/files/run/xml-loop-bug.scala @@ -1,6 +1,8 @@ object Test { def main(args: Array[String]): Unit = { - scala.tools.nsc.io.NullPrintStream.setOutAndErr() + val sink = new java.io.PrintStream(new java.io.ByteArrayOutputStream()) + Console setOut sink + Console setErr sink scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString("<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "), true).document.docElem } } diff --git a/test/files/specialized/SI-5005.check b/test/files/specialized/SI-5005.check index 9fc63a2b1d..81e8342dad 100644 --- a/test/files/specialized/SI-5005.check +++ b/test/files/specialized/SI-5005.check @@ -1,4 +1,4 @@ -[[syntax trees at end of specialize]]// Scala source: newSource1 +[[syntax trees at end of specialize]] // newSource1 package <empty> { class C2[@specialized(scala.Boolean) U >: Nothing <: Any] extends Object { def <init>(): C2[U] = { diff --git a/test/pending/neg/t1557.scala b/test/pending/neg/t1557.scala new file mode 100644 index 0000000000..ba93b45fad --- /dev/null +++ b/test/pending/neg/t1557.scala @@ -0,0 +1,18 @@ +object Test extends App { + trait A + trait B extends A + + trait C { + trait D { type T >: B <: A } + val y: (D with this.type)#T = new B { } + } + + class D extends C { + trait E + type T = E + def frob(arg : E) : E = arg + frob(y) + } + + new D +}
\ No newline at end of file diff --git a/test/pending/neg/t2066.scala b/test/pending/neg/t2066.scala new file mode 100644 index 0000000000..46177b19f7 --- /dev/null +++ b/test/pending/neg/t2066.scala @@ -0,0 +1,16 @@ +object Test extends App { + trait A { + def f[T[_]](x : T[Int]) : T[Any] + } + + class B extends A { + def f[T[+_]](x : T[Int]) : T[Any] = x + } + + class P[Y](var y : Y) + + val p = new P(1) + val palias = (new B():A).f[P](p) + palias.y = "hello" + val z: Int = p.y +}
\ No newline at end of file diff --git a/test/pending/neg/t5378.scala b/test/pending/neg/t5378.scala new file mode 100644 index 0000000000..cada29b0a0 --- /dev/null +++ b/test/pending/neg/t5378.scala @@ -0,0 +1,19 @@ +import language.reflectiveCalls + +class Coll[+T] { + def contains = new { def apply[T1 <: T](value: T1) = ??? } +} + +object Test { + def main(args: Array[String]): Unit = { + val xs = new Coll[List[String]] + val ys: Coll[Traversable[String]] = xs + + println(ys contains Nil) + // java.lang.NoSuchMethodException: Coll$$anon$1.apply(scala.collection.Traversable) + // at java.lang.Class.getMethod(Class.java:1605) + // at Test$.reflMethod$Method1(a.scala:14) + // at Test$.main(a.scala:14) + // at Test.main(a.scala) + } +} diff --git a/test/pending/neg/t796.scala b/test/pending/neg/t796.scala deleted file mode 100644 index c013f49686..0000000000 --- a/test/pending/neg/t796.scala +++ /dev/null @@ -1,20 +0,0 @@ -case class CaseClass( value: Int ); - -object PatternMatchBug { - def matcher( a: AnyRef, b: Any ) { - (a, b) match { - case ( instance: CaseClass, instance.value ) => - System.out.println( "Match succeeded!" ); - case _ => - System.out.println( "Match failed!" ); - } - } - - def main( args : Array[String] ) { - val caseClassInstance = CaseClass( 42 ) - - matcher( caseClassInstance, 13 ) - matcher( caseClassInstance, 42 ) - } -} - diff --git a/test/pending/pos/t1832.scala b/test/pending/pos/t1832.scala new file mode 100644 index 0000000000..bca863f4bd --- /dev/null +++ b/test/pending/pos/t1832.scala @@ -0,0 +1,10 @@ +// Edit by paulp: reduced. +trait Cloning { + trait Foo + def fn(g: Int => Unit): Foo + + implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null } + + val pool1 = 4 * fn { case i => i * 2 } + val pool2 = 4 * fn { case i: Int => i * 2 } +} diff --git a/test/pending/pos/t3439.scala b/test/pending/pos/t3439.scala new file mode 100644 index 0000000000..425f1aeeb5 --- /dev/null +++ b/test/pending/pos/t3439.scala @@ -0,0 +1,2 @@ +abstract class ParametricMessage[M: Manifest](msg: M) { def message = msg } +case class ParametricMessage1[M: Manifest](msg: M, p1: Class[_]) extends ParametricMessage(msg) diff --git a/test/pending/pos/t4717.scala b/test/pending/pos/t4717.scala index 43cf412bc6..7eaa3dd487 100644 --- a/test/pending/pos/t4717.scala +++ b/test/pending/pos/t4717.scala @@ -1,7 +1,7 @@ -trait Bug1[@specialized +A] extends TraversableOnce[A] { - def ++[B >: A](that: TraversableOnce[B]): Iterator[B] = new Iterator[B] { - lazy val it = that.toIterator - def hasNext = it.hasNext - def next = it.next +trait Bounds[@specialized A] { + // okay without `>: A` + def x[B >: A]: Unit = new Bounds[B] { + lazy val it = ??? // def or val okay + it } }
\ No newline at end of file diff --git a/test/pending/pos/t5091.scala b/test/pending/pos/t5091.scala new file mode 100644 index 0000000000..217e83f66d --- /dev/null +++ b/test/pending/pos/t5091.scala @@ -0,0 +1,11 @@ +object RecursiveValueNeedsType { + + def foo(param: String) = 42 + def bar(n: Int) = 42 + + { + val xxx = foo(param = null) + val param = bar(xxx) + } + +} diff --git a/test/pending/pos/t5231.scala b/test/pending/pos/t5231.scala new file mode 100644 index 0000000000..77e6631ebb --- /dev/null +++ b/test/pending/pos/t5231.scala @@ -0,0 +1,18 @@ +object Client { + sealed trait ConfigLike { + def clientID: Int + } + + object Config { + def apply() : ConfigBuilder = new ConfigBuilder() + implicit def build( cb: ConfigBuilder ) : Config = cb.build + } + + final class Config private[Client]( val clientID: Int ) + extends ConfigLike + + final class ConfigBuilder private () extends ConfigLike { + var clientID: Int = 0 + def build : Config = new Config( clientID ) + } +} diff --git a/test/pending/pos/t5265.scala b/test/pending/pos/t5265.scala new file mode 100644 index 0000000000..3be7d2187e --- /dev/null +++ b/test/pending/pos/t5265.scala @@ -0,0 +1,21 @@ +import java.util.Date + +trait TDate + +trait TT[A1,T1] + +trait TTFactory[F,G] { + def create(f: F) : TT[F,G] + def sample: F +} + +object Impls { + + // If the c1 is declared before c2, it compiles fine + implicit def c2(s: Date) = c1.create(s) + + implicit val c1 = new TTFactory[Date,TDate] { + def create(v: Date): TT[Date,TDate] = sys.error("") + def sample = new Date + } +}
\ No newline at end of file diff --git a/test/pending/pos/t5503.flags b/test/pending/pos/t5503.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/pending/pos/t5503.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/pending/pos/t5503.scala b/test/pending/pos/t5503.scala new file mode 100644 index 0000000000..8a1925df1f --- /dev/null +++ b/test/pending/pos/t5503.scala @@ -0,0 +1,18 @@ +trait A { + type Type + type MethodType <: Type + + val MethodType: MethodTypeExtractor = null + + abstract class MethodTypeExtractor { + def unapply(tpe: MethodType): Option[(Any, Any)] + } +} + +object Test { + val a: A = null + + def foo(tpe: a.Type) = tpe match { + case a.MethodType(_, _) => + } +}
\ No newline at end of file diff --git a/test/pending/pos/t5521.scala b/test/pending/pos/t5521.scala new file mode 100644 index 0000000000..dc025d0945 --- /dev/null +++ b/test/pending/pos/t5521.scala @@ -0,0 +1,3 @@ +class Foo { type Bar } + +class Quux(val foo: Foo)(val bar: foo.Bar)
\ No newline at end of file diff --git a/test/pending/pos/t5534.scala b/test/pending/pos/t5534.scala new file mode 100644 index 0000000000..834c4fd68d --- /dev/null +++ b/test/pending/pos/t5534.scala @@ -0,0 +1,11 @@ +object Phrase extends Enumeration { + type Phrase = Value + val PHRASE1 = Value("My phrase 1") + val PHRASE2 = Value("My phrase 2") +} + +class Entity(text:String) + +object Test { + val myMapWithPhrases = Phrase.values.map(p => (p -> new Entity(p.toString))).toMap +}
\ No newline at end of file diff --git a/test/pending/pos/t5564.scala b/test/pending/pos/t5564.scala new file mode 100644 index 0000000000..1783a903ed --- /dev/null +++ b/test/pending/pos/t5564.scala @@ -0,0 +1,5 @@ +trait C + +class Foo[@specialized(Int) T, A] { + def bar[B >: A <: C]: T = ??? +} diff --git a/test/pending/pos/t5579.scala b/test/pending/pos/t5579.scala new file mode 100644 index 0000000000..a1ee077fe7 --- /dev/null +++ b/test/pending/pos/t5579.scala @@ -0,0 +1,29 @@ +import language.existentials + +class Result[+A] + +case class Success[A](x: A) extends Result[A] + +class Apply[A] + +object Apply { + def apply[A](f: Int => Result[A]): Apply[A] = new Apply[A] +} + +object TestUnit { + //Error is here: + def goo = Apply { i => + i match { + case 1 => Success(Some(1)) + case _ => Success(None) + } + } + + //If type is defined explicitly (which I wanted from compiler to infer), then all is ok + def foo = Apply[t forSome { type t >: Some[Int] with None.type <: Option[Int] }] { i => + i match { + case 1 => Success(Some(1)) + case _ => Success(None) + } + } +} diff --git a/test/pending/pos/t5585.scala b/test/pending/pos/t5585.scala new file mode 100644 index 0000000000..5d3eb86111 --- /dev/null +++ b/test/pending/pos/t5585.scala @@ -0,0 +1,18 @@ +class Result[+A] + +case class Success[A](x: A) extends Result[A] + +class Apply[A] + +object Apply { + def apply[A](f: Int => Result[A]): Apply[A] = new Apply[A] +} + +object TestUnit { + def goo : Apply[Option[Int]] = Apply { i => + val p = i match { + case 1 => Success(Some(1)) + case _ => Success(None) + } + } +}
\ No newline at end of file diff --git a/test/pending/pos/t5639/Bar.scala b/test/pending/pos/t5639/Bar.scala new file mode 100644 index 0000000000..f577500acd --- /dev/null +++ b/test/pending/pos/t5639/Bar.scala @@ -0,0 +1,7 @@ +package pack.age + +import pack.age.Implicits._ + +object Quux { + def baz : Baz = 1 +} diff --git a/test/pending/pos/t5639/Foo.scala b/test/pending/pos/t5639/Foo.scala new file mode 100644 index 0000000000..6602150661 --- /dev/null +++ b/test/pending/pos/t5639/Foo.scala @@ -0,0 +1,7 @@ +package pack.age + +class Baz + +object Implicits { + implicit def Baz(n: Int): Baz = new Baz +} diff --git a/test/pending/pos/t5654.scala b/test/pending/pos/t5654.scala new file mode 100644 index 0000000000..eb711a5f37 --- /dev/null +++ b/test/pending/pos/t5654.scala @@ -0,0 +1,4 @@ +case class Bomb(a: Array[_]) +case class Bomb2(a: Array[T] forSome { type T }) +class Okay1(a: Array[_]) +case class Okay2(s: Seq[_])
\ No newline at end of file diff --git a/test/pending/pos/t5712.scala b/test/pending/pos/t5712.scala new file mode 100644 index 0000000000..31f365028a --- /dev/null +++ b/test/pending/pos/t5712.scala @@ -0,0 +1,14 @@ +import scala.tools.nsc._ + +object Test { + + // works + def mkReifier(global: Global)(typer: global.analyzer.Typer) = typer + +/* +<console>:10: error: not found: value global + class Reifier(global: Global)(typer: global.analyzer.Typer) { } +*/ + class Reifier(global: Global)(typer: global.analyzer.Typer) { } + +} diff --git a/test/pending/pos/unapplyGeneric.scala b/test/pending/pos/unapplyGeneric.scala deleted file mode 100644 index bf88816885..0000000000 --- a/test/pending/pos/unapplyGeneric.scala +++ /dev/null @@ -1,11 +0,0 @@ -object Bar { - def unapply[A,B](bar:Bar[A,B]) = Some(bar) -} - -class Bar[A,B](val _1:A, val _2:B) extends Product2[A,B] - -object Test { - new Bar(2, 'a') match { - case Bar(x,y) => - } -} diff --git a/test/pending/pos/z1720.scala b/test/pending/pos/z1720.scala new file mode 100644 index 0000000000..6050f3ff88 --- /dev/null +++ b/test/pending/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) +}
\ No newline at end of file diff --git a/test/pending/run/t3702.scala b/test/pending/run/t3702.scala deleted file mode 100644 index e08fc12e76..0000000000 --- a/test/pending/run/t3702.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Test { - def main(args: Array[String]) { - foo(Nil, Nil) - } - - def foo(h: Any, t: List[Any]) = h match { - case 5 :: _ => () - case List(from) => List(from, from, from) - } -} diff --git a/test/pending/run/t3899.check b/test/pending/run/t3899.check new file mode 100644 index 0000000000..c317608eab --- /dev/null +++ b/test/pending/run/t3899.check @@ -0,0 +1,4 @@ +a,b +a,b +a,b +a,b diff --git a/test/pending/run/t3899/Base_1.java b/test/pending/run/t3899/Base_1.java new file mode 100644 index 0000000000..114cc0b7a6 --- /dev/null +++ b/test/pending/run/t3899/Base_1.java @@ -0,0 +1,5 @@ +public class Base_1 { + public String[] varargs1(String... as) { + return as; + } +} diff --git a/test/pending/run/t3899/Derived_2.scala b/test/pending/run/t3899/Derived_2.scala new file mode 100644 index 0000000000..bb4e53784d --- /dev/null +++ b/test/pending/run/t3899/Derived_2.scala @@ -0,0 +1,30 @@ +trait T extends Base_1 { + def t1(as: String*): Array[String] = { + varargs1(as: _*) + } + def t2(as: String*): Array[String] = { + // This is the bug reported in the ticket. + super.varargs1(as: _*) + } +} + +class C extends Base_1 { + def c1(as: String*): Array[String] = { + varargs1(as: _*) + } + def c2(as: String*): Array[String] = { + super.varargs1(as: _*) + } +} + + +object Test extends App { + val t = new T {} + println(t.t1("a", "b").mkString(",")) + println(t.t2("a", "b").mkString(",")) + + val c = new C {} + println(c.c1("a", "b").mkString(",")) + println(c.c2("a", "b").mkString(",")) + +} diff --git a/test/pending/run/t4560.scala b/test/pending/run/t4560.scala new file mode 100644 index 0000000000..fe62136319 --- /dev/null +++ b/test/pending/run/t4560.scala @@ -0,0 +1,9 @@ +trait B { + this: Test.type => + + def y = new { def f() = () } + def fail() = y.f() +} +object Test extends B { + def main(args: Array[String]): Unit = fail() +}
\ No newline at end of file diff --git a/test/pending/run/t4728.check b/test/pending/run/t4728.check new file mode 100644 index 0000000000..7a754f414c --- /dev/null +++ b/test/pending/run/t4728.check @@ -0,0 +1,2 @@ +1 +2
\ No newline at end of file diff --git a/test/pending/run/t4728.scala b/test/pending/run/t4728.scala new file mode 100644 index 0000000000..36f7860613 --- /dev/null +++ b/test/pending/run/t4728.scala @@ -0,0 +1,11 @@ +class X +class Y extends X +object Ambiguous { + def f(x: X) = 1 + def f(ys: Y*) = 2 +} + +object Test extends App { + println(Ambiguous.f(new X)) + println(Ambiguous.f(new Y)) +}
\ No newline at end of file diff --git a/test/pending/run/t5610a.check b/test/pending/run/t5610a.check new file mode 100644 index 0000000000..2aa46b3b91 --- /dev/null +++ b/test/pending/run/t5610a.check @@ -0,0 +1 @@ +Stroke a kitten diff --git a/test/pending/run/t5610a.scala b/test/pending/run/t5610a.scala new file mode 100644 index 0000000000..f20b295762 --- /dev/null +++ b/test/pending/run/t5610a.scala @@ -0,0 +1,19 @@ +object Test extends App { + class Result(_str: => String) { + lazy val str = _str + } + + def foo(str: => String)(i: Int) = new Result(str) + + def bar(f: Int => Result) = f(42) + + var test: String = null + val result = bar(foo(test)) + test = "bar" + + if (result.str == null) { + println("Destroy ALL THE THINGS!!!") + } else { + println("Stroke a kitten") + } +}
\ No newline at end of file diff --git a/test/pending/run/t5610b.check b/test/pending/run/t5610b.check new file mode 100644 index 0000000000..2aa46b3b91 --- /dev/null +++ b/test/pending/run/t5610b.check @@ -0,0 +1 @@ +Stroke a kitten diff --git a/test/pending/run/t5610b.scala b/test/pending/run/t5610b.scala new file mode 100644 index 0000000000..d922d6333c --- /dev/null +++ b/test/pending/run/t5610b.scala @@ -0,0 +1,21 @@ +object Bug { + def main(args: Array[String]) { + var test: String = null + val result = bar(foo(test)) + test = "bar" + + if (result.str == null) { + println("Destroy ALL THE THINGS!!!") + } else { + println("Stroke a kitten") + } + } + + class Result(_str: => String) { + lazy val str = _str + } + + def foo(str: => String)(i: Int) = new Result(str) + + def bar(f: Int => Result) = f(42) +}
\ No newline at end of file diff --git a/test/pending/run/t5629.scala b/test/pending/run/t5629.scala deleted file mode 100644 index 28e74a1c94..0000000000 --- a/test/pending/run/t5629.scala +++ /dev/null @@ -1,25 +0,0 @@ -import scala.{specialized => spec} - -trait GrandParent[@spec(Int) -A] { - def foo(a:A): Unit - def bar[B <: A](b:B): Unit = println("grandparent got: %s" format b) -} - -trait Parent[@spec(Int) -A] extends GrandParent[A] { - def foo(a:A) = bar(a) -} - -class IntChild extends Parent[Int] { - override def bar[B <: Int](b:B): Unit = println("int child got: %s" format b) -} - -class AnyChild extends Parent[Any] { - override def bar[B <: Any](b:B): Unit = println("any child got: %s" format b) -} - -object Test { - def main(args:Array[String]) { - new IntChild().foo(33) - new AnyChild().foo(33) - } -} diff --git a/test/pending/run/t5676.scala b/test/pending/run/t5676.scala deleted file mode 100644 index 3ff498eaa2..0000000000 --- a/test/pending/run/t5676.scala +++ /dev/null @@ -1,25 +0,0 @@ - - - - -class Bar[T] - - -class Foo[T] { - object A extends Bar[T] -} - - -class Baz[S] extends Foo[S] { - override object A extends Bar[S] -} - - -object Test { - - def main(a: Array[String]) { - val b = new Baz[Any] - println(b) - } - -} diff --git a/test/pending/run/t5695.check b/test/pending/run/t5695.check new file mode 100644 index 0000000000..d50069ab4f --- /dev/null +++ b/test/pending/run/t5695.check @@ -0,0 +1,2 @@ +.. +.. diff --git a/test/pending/run/t5695/part_1.scala b/test/pending/run/t5695/part_1.scala new file mode 100644 index 0000000000..b8e8f8e52f --- /dev/null +++ b/test/pending/run/t5695/part_1.scala @@ -0,0 +1,12 @@ +import language.experimental.macros +import scala.reflect.makro.Context + +object Defs { + + def mkInt = macro mkIntImpl + def mkIntImpl(c: Context): c.Expr[Any] = { + println(c.enclosingApplication) + c.reify{ 23 } + } + +} diff --git a/test/pending/run/t5695/part_2.scala b/test/pending/run/t5695/part_2.scala new file mode 100644 index 0000000000..d34219437d --- /dev/null +++ b/test/pending/run/t5695/part_2.scala @@ -0,0 +1,8 @@ +import Defs._ + +object Test extends App { + + val i1 = mkInt + val i2 = identity(mkInt) + +} diff --git a/test/pending/run/t5722.scala b/test/pending/run/t5722.scala new file mode 100644 index 0000000000..21ace060d6 --- /dev/null +++ b/test/pending/run/t5722.scala @@ -0,0 +1,6 @@ +object Test extends App { + def foo[T: ClassTag] = println(classOf[T]) + foo[Int] + foo[Array[Int]] + foo[List[Int]] +}
\ No newline at end of file diff --git a/test/pending/run/t5726a.scala b/test/pending/run/t5726a.scala new file mode 100644 index 0000000000..24d828a159 --- /dev/null +++ b/test/pending/run/t5726a.scala @@ -0,0 +1,17 @@ +import language.dynamics + +class DynamicTest extends Dynamic { + def selectDynamic(name: String) = s"value of $name" + def updateDynamic(name: String)(value: Any) { + println(s"You have just updated property '$name' with value: $value") + } +} + +object MyApp extends App { + def testing() { + val test = new DynamicTest + test.firstName = "John" + } + + testing() +}
\ No newline at end of file diff --git a/test/pending/run/t5726b.scala b/test/pending/run/t5726b.scala new file mode 100644 index 0000000000..839dcf40b5 --- /dev/null +++ b/test/pending/run/t5726b.scala @@ -0,0 +1,16 @@ +import language.dynamics + +class DynamicTest extends Dynamic { + def updateDynamic(name: String)(value: Any) { + println(s"You have just updated property '$name' with value: $value") + } +} + +object MyApp extends App { + def testing() { + val test = new DynamicTest + test.firstName = "John" + } + + testing() +}
\ No newline at end of file |