diff options
author | Aleksandar Prokopec <axel22@gmail.com> | 2012-03-21 15:21:00 +0100 |
---|---|---|
committer | Aleksandar Prokopec <axel22@gmail.com> | 2012-03-21 15:21:00 +0100 |
commit | 0321df7292018d1e7408ef9ad193c8fc7bf4765d (patch) | |
tree | 6152d94c2b614bb823f75d864c2a729e8221248a /test/files/run | |
parent | 13a325b126ac6f2f5d2e7d1fc2c008d012367430 (diff) | |
parent | f6c050e8cfa5bd1ee4bbb3434086d2ae2d35e5f7 (diff) | |
download | scala-0321df7292018d1e7408ef9ad193c8fc7bf4765d.tar.gz scala-0321df7292018d1e7408ef9ad193c8fc7bf4765d.tar.bz2 scala-0321df7292018d1e7408ef9ad193c8fc7bf4765d.zip |
Merge branch 'master' into feature/pc-execution-contexts
Diffstat (limited to 'test/files/run')
39 files changed, 1601 insertions, 130 deletions
diff --git a/test/files/run/Meter.check b/test/files/run/Meter.check new file mode 100644 index 0000000000..7562f9a1bf --- /dev/null +++ b/test/files/run/Meter.check @@ -0,0 +1,21 @@ +2.0 +4.0m +false +x.isInstanceOf[Meter]: true +x.hashCode: 1072693248 +x == 1: false +x == y: true +a == b: true +testing native arrays +Array(1.0m, 2.0m) +1.0m +>>>1.0m<<< 1.0m +>>>2.0m<<< 2.0m +testing wrapped arrays +FlatArray(1.0m, 2.0m) +1.0m +>>>1.0m<<< 1.0m +>>>2.0m<<< 2.0m +FlatArray(2.0m, 3.0m) +ArrayBuffer(1.0, 2.0) +FlatArray(0.3048ft, 0.6096ft) diff --git a/test/files/run/Meter.scala b/test/files/run/Meter.scala new file mode 100644 index 0000000000..515e46de24 --- /dev/null +++ b/test/files/run/Meter.scala @@ -0,0 +1,102 @@ +package a { + class Meter(val underlying: Double) extends AnyVal with _root_.b.Printable { + def + (other: Meter): Meter = + new Meter(this.underlying + other.underlying) + def / (other: Meter): Double = this.underlying / other.underlying + def / (factor: Double): Meter = new Meter(this.underlying / factor) + def < (other: Meter): Boolean = this.underlying < other.underlying + def toFoot: Foot = new Foot(this.underlying * 0.3048) + override def print = { Console.print(">>>"); super.print; proprint } + override def toString: String = underlying.toString+"m" + } + + object Meter extends (Double => Meter) { + + def apply(x: Double): Meter = new Meter(x) + + implicit val boxings = new BoxingConversions[Meter, Double] { + def box(x: Double) = new Meter(x) + def unbox(m: Meter) = m.underlying + } + } + + class Foot(val unbox: Double) extends AnyVal { + def + (other: Foot): Foot = + new Foot(this.unbox + other.unbox) + override def toString = unbox.toString+"ft" + } + object Foot { + implicit val boxings = new BoxingConversions[Foot, Double] { + def box(x: Double) = new Foot(x) + def unbox(m: Foot) = m.unbox + } + } + +} +package b { + trait Printable extends Any { + def print: Unit = Console.print(this) + protected def proprint = Console.print("<<<") + } +} +import a._ +import _root_.b._ +object Test extends App { + + { + val x: Meter = new Meter(1) + val a: Object = x.asInstanceOf[Object] + val y: Meter = a.asInstanceOf[Meter] + + val u: Double = 1 + val b: Object = u.asInstanceOf[Object] + val v: Double = b.asInstanceOf[Double] + } + + val x = new Meter(1) + val y = x + println((x + x) / x) + println((x + x) / 0.5) + println((x < x).toString) + println("x.isInstanceOf[Meter]: "+x.isInstanceOf[Meter]) + + + println("x.hashCode: "+x.hashCode) + println("x == 1: "+(x == 1)) + println("x == y: "+(x == y)) + assert(x.hashCode == (1.0).hashCode) + + val a: Any = x + val b: Any = y + println("a == b: "+(a == b)) + + { println("testing native arrays") + val arr = Array(x, y + x) + println(arr.deep) + def foo[T <: Printable](x: Array[T]) { + for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + } + val m = arr(0) + println(m) + foo(arr) + } + + { println("testing wrapped arrays") + import collection.mutable.FlatArray + val arr = FlatArray(x, y + x) + println(arr) + def foo(x: FlatArray[Meter]) { + for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + } + val m = arr(0) + println(m) + foo(arr) + val ys: Seq[Meter] = arr map (_ + new Meter(1)) + println(ys) + val zs = arr map (_ / Meter(1)) + println(zs) + val fs = arr map (_.toFoot) + println(fs) + } + +} diff --git a/test/files/run/MeterCaseClass.check b/test/files/run/MeterCaseClass.check new file mode 100644 index 0000000000..08370d2097 --- /dev/null +++ b/test/files/run/MeterCaseClass.check @@ -0,0 +1,21 @@ +2.0 +Meter(4.0) +false +x.isInstanceOf[Meter]: true +x.hashCode: 1072693248 +x == 1: false +x == y: true +a == b: true +testing native arrays +Array(Meter(1.0), Meter(2.0)) +Meter(1.0) +>>>Meter(1.0)<<< Meter(1.0) +>>>Meter(2.0)<<< Meter(2.0) +testing wrapped arrays +FlatArray(Meter(1.0), Meter(2.0)) +Meter(1.0) +>>>Meter(1.0)<<< Meter(1.0) +>>>Meter(2.0)<<< Meter(2.0) +FlatArray(Meter(2.0), Meter(3.0)) +ArrayBuffer(1.0, 2.0) +FlatArray(0.3048ft, 0.6096ft) diff --git a/test/files/run/MeterCaseClass.scala b/test/files/run/MeterCaseClass.scala new file mode 100644 index 0000000000..8459163f31 --- /dev/null +++ b/test/files/run/MeterCaseClass.scala @@ -0,0 +1,99 @@ +package a { + case class Meter(underlying: Double) extends AnyVal with _root_.b.Printable { + def + (other: Meter): Meter = + new Meter(this.underlying + other.underlying) + def / (other: Meter): Double = this.underlying / other.underlying + def / (factor: Double): Meter = new Meter(this.underlying / factor) + def < (other: Meter): Boolean = this.underlying < other.underlying + def toFoot: Foot = new Foot(this.underlying * 0.3048) + override def print = { Console.print(">>>"); super.print; proprint } + } + + object Meter extends (Double => Meter) { + + implicit val boxings = new BoxingConversions[Meter, Double] { + def box(x: Double) = new Meter(x) + def unbox(m: Meter) = m.underlying + } + } + + class Foot(val unbox: Double) extends AnyVal { + def + (other: Foot): Foot = + new Foot(this.unbox + other.unbox) + override def toString = unbox.toString+"ft" + } + object Foot { + implicit val boxings = new BoxingConversions[Foot, Double] { + def box(x: Double) = new Foot(x) + def unbox(m: Foot) = m.unbox + } + } + +} +package b { + trait Printable extends Any { + def print: Unit = Console.print(this) + protected def proprint = Console.print("<<<") + } +} +import a._ +import _root_.b._ +object Test extends App { + + { + val x: Meter = new Meter(1) + val a: Object = x.asInstanceOf[Object] + val y: Meter = a.asInstanceOf[Meter] + + val u: Double = 1 + val b: Object = u.asInstanceOf[Object] + val v: Double = b.asInstanceOf[Double] + } + + val x = new Meter(1) + val y = x + println((x + x) / x) + println((x + x) / 0.5) + println((x < x).toString) + println("x.isInstanceOf[Meter]: "+x.isInstanceOf[Meter]) + + + println("x.hashCode: "+x.hashCode) + println("x == 1: "+(x == 1)) + println("x == y: "+(x == y)) + assert(x.hashCode == (1.0).hashCode) + + val a: Any = x + val b: Any = y + println("a == b: "+(a == b)) + + { println("testing native arrays") + val arr = Array(x, y + x) + println(arr.deep) + def foo[T <: Printable](x: Array[T]) { + for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + } + val m = arr(0) + println(m) + foo(arr) + } + + { println("testing wrapped arrays") + import collection.mutable.FlatArray + val arr = FlatArray(x, y + x) + println(arr) + def foo(x: FlatArray[Meter]) { + for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + } + val m = arr(0) + println(m) + foo(arr) + val ys: Seq[Meter] = arr map (_ + new Meter(1)) + println(ys) + val zs = arr map (_ / Meter(1)) + println(zs) + val fs = arr map (_.toFoot) + println(fs) + } + +} diff --git a/test/files/run/color.check b/test/files/run/color.check new file mode 100644 index 0000000000..598cc145f0 --- /dev/null +++ b/test/files/run/color.check @@ -0,0 +1,693 @@ + +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 new file mode 100644 index 0000000000..a0af8477e7 --- /dev/null +++ b/test/files/run/color.scala @@ -0,0 +1,33 @@ +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/compiler-asSeenFrom.check b/test/files/run/compiler-asSeenFrom.check new file mode 100644 index 0000000000..f198e61072 --- /dev/null +++ b/test/files/run/compiler-asSeenFrom.check @@ -0,0 +1,323 @@ +class C { + type seen from prefix is + ---- ---------------- -- + C[List[T3]]#I[T1] D[A1] C[List[T3]]#I[A1] + C[List[T3]]#I[T1] D[T3] C[List[T3]]#I[T3] + C[List[T3]]#J[T1] D[A1] C[List[T3]]#J[A1] + C[List[T3]]#J[T1] D[T3] C[List[T3]]#J[T3] + C[T1]#I[Int] C[List[T3]] C[List[T3]]#I[Int] + C[T1]#I[Int] D[A1] C[A1]#I[Int] + C[T1]#I[Int] D[T3] C[T3]#I[Int] + C[T1]#I[List[Int]] C[List[T3]] C[List[T3]]#I[List[Int]] + C[T1]#I[List[Int]] D[A1] C[A1]#I[List[Int]] + C[T1]#I[List[Int]] D[T3] C[T3]#I[List[Int]] + C[T1]#I[T1] C[List[T3]] C[List[T3]]#I[List[T3]] + C[T1]#I[T1] D[A1] C[A1]#I[A1] + C[T1]#I[T1] D[T3] C[T3]#I[T3] + C[T1]#I[T2] C[List[T3]] C[List[T3]]#I[T2] + C[T1]#I[T2] D[A1] C[A1]#I[T2] + C[T1]#I[T2] D[T3] C[T3]#I[T2] + C[T1]#I[T3] C[List[T3]] C[List[T3]]#I[T3] + C[T1]#I[T3] D[A1] C[A1]#I[T3] + C[T1]#I[T3] D[T3] C[T3]#I[T3] + C[T1]#I[T4] C[List[T3]] C[List[T3]]#I[T4] + C[T1]#I[T4] D[A1] C[A1]#I[T4] + C[T1]#I[T4] D[T3] C[T3]#I[T4] + C[T1]#J[Int] C[List[T3]] C[List[T3]]#J[Int] + C[T1]#J[Int] D[A1] C[A1]#J[Int] + C[T1]#J[Int] D[T3] C[T3]#J[Int] + C[T1]#J[List[Int]] C[List[T3]] C[List[T3]]#J[List[Int]] + C[T1]#J[List[Int]] D[A1] C[A1]#J[List[Int]] + C[T1]#J[List[Int]] D[T3] C[T3]#J[List[Int]] + C[T1]#J[T1] C[List[T3]] C[List[T3]]#J[List[T3]] + C[T1]#J[T1] D[A1] C[A1]#J[A1] + C[T1]#J[T1] D[T3] C[T3]#J[T3] + C[T1]#J[T2] C[List[T3]] C[List[T3]]#J[T2] + C[T1]#J[T2] D[A1] C[A1]#J[T2] + C[T1]#J[T2] D[T3] C[T3]#J[T2] + C[T1]#J[T3] C[List[T3]] C[List[T3]]#J[T3] + C[T1]#J[T3] D[A1] C[A1]#J[T3] + C[T1]#J[T3] D[T3] C[T3]#J[T3] + C[T1]#J[T4] C[List[T3]] C[List[T3]]#J[T4] + C[T1]#J[T4] D[A1] C[A1]#J[T4] + C[T1]#J[T4] D[T3] C[T3]#J[T4] + D[T3]#J[T1] C[List[T3]] D[T3]#J[List[T3]] + D[T3]#J[T1] D[A1] D[T3]#J[A1] + D[A1]#J[T1] C[List[T3]] D[A1]#J[List[T3]] + D[A1]#J[T1] D[T3] D[A1]#J[T3] +} +class D { + type seen from prefix is + ---- ---------------- -- + C[List[T3]]#I[Int] D[A1] C[List[A1]]#I[Int] + C[List[T3]]#I[List[Int]] D[A1] C[List[A1]]#I[List[Int]] + C[List[T3]]#I[T1] D[A1] C[List[A1]]#I[T1] + C[List[T3]]#I[T2] D[A1] C[List[A1]]#I[T2] + C[List[T3]]#I[T3] D[A1] C[List[A1]]#I[A1] + C[List[T3]]#I[T4] D[A1] C[List[A1]]#I[T4] + C[List[T3]]#J[Int] D[A1] C[List[A1]]#J[Int] + C[List[T3]]#J[List[Int]] D[A1] C[List[A1]]#J[List[Int]] + C[List[T3]]#J[T1] D[A1] C[List[A1]]#J[T1] + C[List[T3]]#J[T2] D[A1] C[List[A1]]#J[T2] + C[List[T3]]#J[T3] D[A1] C[List[A1]]#J[A1] + C[List[T3]]#J[T4] D[A1] C[List[A1]]#J[T4] + C[T1]#I[T3] D[A1] C[T1]#I[A1] + C[T1]#J[T3] D[A1] C[T1]#J[A1] + D[T3]#J[Int] D[A1] D[A1]#J[Int] + D[T3]#J[List[Int]] D[A1] D[A1]#J[List[Int]] + D[T3]#J[T1] D[A1] D[A1]#J[T1] + D[T3]#J[T2] D[A1] D[A1]#J[T2] + D[T3]#J[T3] D[A1] D[A1]#J[A1] + D[T3]#J[T4] D[A1] D[A1]#J[T4] +} +class I { + type seen from prefix is + ---- ---------------- -- + C[List[T3]]#I[T1] D.this.J[T4] C[List[T3]]#I[List[T3]] + C[List[T3]]#I[T1] Z.dZ.J[A2] C[List[T3]]#I[List[A1]] + C[List[T3]]#I[T1] Z.dZ.J[P] C[List[T3]]#I[List[A1]] + C[List[T3]]#I[T2] D.this.J[T4] C[List[T3]]#I[T4] + C[List[T3]]#I[T2] Z.dZ.J[A2] C[List[T3]]#I[A2] + C[List[T3]]#I[T2] Z.dZ.J[P] C[List[T3]]#I[P] + C[List[T3]]#J[T1] D.this.J[T4] C[List[T3]]#J[List[T3]] + C[List[T3]]#J[T1] Z.dZ.J[A2] C[List[T3]]#J[List[A1]] + C[List[T3]]#J[T1] Z.dZ.J[P] C[List[T3]]#J[List[A1]] + C[List[T3]]#J[T2] D.this.J[T4] C[List[T3]]#J[T4] + C[List[T3]]#J[T2] Z.dZ.J[A2] C[List[T3]]#J[A2] + C[List[T3]]#J[T2] Z.dZ.J[P] C[List[T3]]#J[P] + C[T1]#I[Int] D.this.J[T4] C[List[T3]]#I[Int] + C[T1]#I[Int] Z.dZ.J[A2] C[List[A1]]#I[Int] + C[T1]#I[Int] Z.dZ.J[P] C[List[A1]]#I[Int] + C[T1]#I[List[Int]] D.this.J[T4] C[List[T3]]#I[List[Int]] + C[T1]#I[List[Int]] Z.dZ.J[A2] C[List[A1]]#I[List[Int]] + C[T1]#I[List[Int]] Z.dZ.J[P] C[List[A1]]#I[List[Int]] + C[T1]#I[T1] D.this.J[T4] C[List[T3]]#I[List[T3]] + C[T1]#I[T1] Z.dZ.J[A2] C[List[A1]]#I[List[A1]] + C[T1]#I[T1] Z.dZ.J[P] C[List[A1]]#I[List[A1]] + C[T1]#I[T2] D.this.J[T4] C[List[T3]]#I[T4] + C[T1]#I[T2] Z.dZ.J[A2] C[List[A1]]#I[A2] + C[T1]#I[T2] Z.dZ.J[P] C[List[A1]]#I[P] + C[T1]#I[T3] D.this.J[T4] C[List[T3]]#I[T3] + C[T1]#I[T3] Z.dZ.J[A2] C[List[A1]]#I[T3] + C[T1]#I[T3] Z.dZ.J[P] C[List[A1]]#I[T3] + C[T1]#I[T4] D.this.J[T4] C[List[T3]]#I[T4] + C[T1]#I[T4] Z.dZ.J[A2] C[List[A1]]#I[T4] + C[T1]#I[T4] Z.dZ.J[P] C[List[A1]]#I[T4] + C[T1]#J[Int] D.this.J[T4] C[List[T3]]#J[Int] + C[T1]#J[Int] Z.dZ.J[A2] C[List[A1]]#J[Int] + C[T1]#J[Int] Z.dZ.J[P] C[List[A1]]#J[Int] + C[T1]#J[List[Int]] D.this.J[T4] C[List[T3]]#J[List[Int]] + C[T1]#J[List[Int]] Z.dZ.J[A2] C[List[A1]]#J[List[Int]] + C[T1]#J[List[Int]] Z.dZ.J[P] C[List[A1]]#J[List[Int]] + C[T1]#J[T1] D.this.J[T4] C[List[T3]]#J[List[T3]] + C[T1]#J[T1] Z.dZ.J[A2] C[List[A1]]#J[List[A1]] + C[T1]#J[T1] Z.dZ.J[P] C[List[A1]]#J[List[A1]] + C[T1]#J[T2] D.this.J[T4] C[List[T3]]#J[T4] + C[T1]#J[T2] Z.dZ.J[A2] C[List[A1]]#J[A2] + C[T1]#J[T2] Z.dZ.J[P] C[List[A1]]#J[P] + C[T1]#J[T3] D.this.J[T4] C[List[T3]]#J[T3] + C[T1]#J[T3] Z.dZ.J[A2] C[List[A1]]#J[T3] + C[T1]#J[T3] Z.dZ.J[P] C[List[A1]]#J[T3] + C[T1]#J[T4] D.this.J[T4] C[List[T3]]#J[T4] + C[T1]#J[T4] Z.dZ.J[A2] C[List[A1]]#J[T4] + C[T1]#J[T4] Z.dZ.J[P] C[List[A1]]#J[T4] + D[T3]#J[T1] D.this.J[T4] D[T3]#J[List[T3]] + D[T3]#J[T1] Z.dZ.J[A2] D[T3]#J[List[A1]] + D[T3]#J[T1] Z.dZ.J[P] D[T3]#J[List[A1]] + D[T3]#J[T2] D.this.J[T4] D[T3]#J[T4] + D[T3]#J[T2] Z.dZ.J[A2] D[T3]#J[A2] + D[T3]#J[T2] Z.dZ.J[P] D[T3]#J[P] + D[A1]#J[T1] D.this.J[T4] D[A1]#J[List[T3]] + D[A1]#J[T1] Z.dZ.J[A2] D[A1]#J[List[A1]] + D[A1]#J[T1] Z.dZ.J[P] D[A1]#J[List[A1]] + D[A1]#J[T2] D.this.J[T4] D[A1]#J[T4] + D[A1]#J[T2] Z.dZ.J[A2] D[A1]#J[A2] + D[A1]#J[T2] Z.dZ.J[P] D[A1]#J[P] +} +class J { + type seen from prefix is + ---- ---------------- -- + C[List[T3]]#I[Int] Z.dZ.J[A2] C[List[A1]]#I[Int] + C[List[T3]]#I[Int] Z.dZ.J[P] C[List[A1]]#I[Int] + C[List[T3]]#I[List[Int]] Z.dZ.J[A2] C[List[A1]]#I[List[Int]] + C[List[T3]]#I[List[Int]] Z.dZ.J[P] C[List[A1]]#I[List[Int]] + C[List[T3]]#I[T1] Z.dZ.J[A2] C[List[A1]]#I[T1] + C[List[T3]]#I[T1] Z.dZ.J[P] C[List[A1]]#I[T1] + C[List[T3]]#I[T2] Z.dZ.J[A2] C[List[A1]]#I[T2] + C[List[T3]]#I[T2] Z.dZ.J[P] C[List[A1]]#I[T2] + C[List[T3]]#I[T3] Z.dZ.J[A2] C[List[A1]]#I[A1] + C[List[T3]]#I[T3] Z.dZ.J[P] C[List[A1]]#I[A1] + C[List[T3]]#I[T4] Z.dZ.J[A2] C[List[A1]]#I[A2] + C[List[T3]]#I[T4] Z.dZ.J[P] C[List[A1]]#I[P] + C[List[T3]]#J[Int] Z.dZ.J[A2] C[List[A1]]#J[Int] + C[List[T3]]#J[Int] Z.dZ.J[P] C[List[A1]]#J[Int] + C[List[T3]]#J[List[Int]] Z.dZ.J[A2] C[List[A1]]#J[List[Int]] + C[List[T3]]#J[List[Int]] Z.dZ.J[P] C[List[A1]]#J[List[Int]] + C[List[T3]]#J[T1] Z.dZ.J[A2] C[List[A1]]#J[T1] + C[List[T3]]#J[T1] Z.dZ.J[P] C[List[A1]]#J[T1] + C[List[T3]]#J[T2] Z.dZ.J[A2] C[List[A1]]#J[T2] + C[List[T3]]#J[T2] Z.dZ.J[P] C[List[A1]]#J[T2] + C[List[T3]]#J[T3] Z.dZ.J[A2] C[List[A1]]#J[A1] + C[List[T3]]#J[T3] Z.dZ.J[P] C[List[A1]]#J[A1] + C[List[T3]]#J[T4] Z.dZ.J[A2] C[List[A1]]#J[A2] + C[List[T3]]#J[T4] Z.dZ.J[P] C[List[A1]]#J[P] + C[T1]#I[T3] Z.dZ.J[A2] C[T1]#I[A1] + C[T1]#I[T3] Z.dZ.J[P] C[T1]#I[A1] + C[T1]#I[T4] Z.dZ.J[A2] C[T1]#I[A2] + C[T1]#I[T4] Z.dZ.J[P] C[T1]#I[P] + C[T1]#J[T3] Z.dZ.J[A2] C[T1]#J[A1] + C[T1]#J[T3] Z.dZ.J[P] C[T1]#J[A1] + C[T1]#J[T4] Z.dZ.J[A2] C[T1]#J[A2] + C[T1]#J[T4] Z.dZ.J[P] C[T1]#J[P] + D[T3]#J[Int] Z.dZ.J[A2] D[A1]#J[Int] + D[T3]#J[Int] Z.dZ.J[P] D[A1]#J[Int] + D[T3]#J[List[Int]] Z.dZ.J[A2] D[A1]#J[List[Int]] + D[T3]#J[List[Int]] Z.dZ.J[P] D[A1]#J[List[Int]] + D[T3]#J[T1] Z.dZ.J[A2] D[A1]#J[T1] + D[T3]#J[T1] Z.dZ.J[P] D[A1]#J[T1] + D[T3]#J[T2] Z.dZ.J[A2] D[A1]#J[T2] + D[T3]#J[T2] Z.dZ.J[P] D[A1]#J[T2] + D[T3]#J[T3] Z.dZ.J[A2] D[A1]#J[A1] + D[T3]#J[T3] Z.dZ.J[P] D[A1]#J[A1] + D[T3]#J[T4] Z.dZ.J[A2] D[A1]#J[A2] + D[T3]#J[T4] Z.dZ.J[P] D[A1]#J[P] + D[A1]#J[T3] Z.dZ.J[A2] D[A1]#J[A1] + D[A1]#J[T3] Z.dZ.J[P] D[A1]#J[A1] + D[A1]#J[T4] Z.dZ.J[A2] D[A1]#J[A2] + D[A1]#J[T4] Z.dZ.J[P] D[A1]#J[P] +} +class D { // after parser + private val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +class D { // after uncurry + private val cD: ll.C[List[T3]] + val cD(): ll.C[List[T3]] +} + +class D { // after erasure + private val cD: ll.C + val cD(): ll.C +} + +object Z { // after parser + def kz[P <: ll.Z.dZ.J[ll.A2]]: ll.Z.dZ.J[P] + private val jZ: ll.Z.dZ.J[ll.A2] + val jZ: ll.Z.dZ.J[ll.A2] + private val dZ: ll.D[ll.A1] + val dZ: ll.D[ll.A1] +} + +object Z { // after uncurry + def kz[P <: ll.Z.dZ.J[ll.A2]](): ll.Z.dZ.J[P] + private val jZ: ll.Z.dZ.J[ll.A2] + val jZ(): ll.Z.dZ.J[ll.A2] + private val dZ: ll.D[ll.A1] + val dZ(): ll.D[ll.A1] +} + +object Z { // after erasure + def kz(): ll.D#J + private val jZ: ll.D#J + val jZ(): ll.D#J + private val dZ: ll.D + val dZ(): ll.D +} + +object Z { // after flatten + def kz(): ll.D#D$J + private val jZ: ll.D#D$J + val jZ(): ll.D#D$J + private val dZ: ll.D + val dZ(): ll.D +} + +value dZ { // after parser + private val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +value dZ { // after parser + private val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +value dZ { // after uncurry + private val cD: ll.C[List[T3]] + val cD(): ll.C[List[T3]] +} + +value dZ { // after erasure + private val cD: ll.C + val cD(): ll.C +} + +value jZ { // after parser + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value jZ { // after parser + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value jZ { // after explicitouter + protected val $outer: D.this.type + val ll$D$J$$$outer(): D.this.type + val ll$C$I$$$outer(): C.this.type + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value jZ { // after erasure + protected val $outer: ll.D + val ll$D$J$$$outer(): ll.D + protected val $outer: ll.C + val ll$C$I$$$outer(): ll.C + def thisI(): ll.C#I + def thisC(): ll.C + def t2(): Object + def t1(): Object +} + +value jZ { // after flatten + protected val $outer: ll.D + val ll$D$J$$$outer(): ll.D + protected val $outer: ll.C + val ll$C$I$$$outer(): ll.C + def thisI(): ll.C#C$I + def thisC(): ll.C + def t2(): Object + def t1(): Object +} + +method kz { // after parser + def thisI(): I.this.type + def thisC(): C.this.type + def t2(): T2 + def t1(): T1 +} + +value $outer { // after parser + private val cD: ll.C[List[T3]] + val cD: ll.C[List[T3]] +} + +value $outer { // after uncurry + private val cD: ll.C[List[T3]] + val cD(): ll.C[List[T3]] +} + +value $outer { // after erasure + private val cD: ll.C + val cD(): ll.C +} + diff --git a/test/files/run/compiler-asSeenFrom.scala b/test/files/run/compiler-asSeenFrom.scala new file mode 100644 index 0000000000..1fc3a5ee71 --- /dev/null +++ b/test/files/run/compiler-asSeenFrom.scala @@ -0,0 +1,122 @@ +import scala.tools.nsc._ +import scala.tools.partest.CompilerTest +import scala.collection.{ mutable, immutable, generic } + +/** It's too messy but it's better than not having it. + */ +object Test extends CompilerTest { + import global._ + import definitions._ + + override def sources = List(lambdaLift) + def lambdaLift = """ +package ll { + class A1 + class A2 + class X + class C[T1]() { + class I[T2]() { + def t1(): T1 = ??? + def t2(): T2 = ??? + def thisC(): C.this.type = ??? + def thisI(): I.this.type = ??? + } + } + class D[T3]() extends C[T3]() { + val cD: C[List[T3]] = ??? + class J[T4]() extends cD.I[T4]() + } + object Z { + val dZ: D[A1] = ??? + val jZ: dZ.J[A2] = ??? + + def kz[P <: dZ.J[A2]]: dZ.J[P] = ??? + } +} +""" + + object syms extends SymsInPackage("ll") { + def isPossibleEnclosure(encl: Symbol, sym: Symbol) = sym.enclClassChain drop 1 exists (_ isSubClass encl) + def isInterestingPrefix(pre: Type) = pre.typeConstructor.typeParams.nonEmpty && pre.members.exists(_.isType) + + def asSeenPrefixes = tpes map (_.finalResultType) distinct + def typeRefPrefixes = asSeenPrefixes filter isInterestingPrefix + + def nestsIn(outer: Symbol) = classes filter (c => c.enclClassChain drop 1 exists(_ isSubClass outer)) + def typeRefs(targs: List[Type]) = ( + for (p <- typeRefPrefixes ; c <- classes filter (isPossibleEnclosure(p.typeSymbol, _)) ; a <- targs) yield + typeRef(p, c, List(a)) + ) + + val wfmt = "%-" + 25 + "s" + def to_s(x: Any): String = wfmt.format(x.toString.replaceAll("""\bll\.""", "")) + + def fmt(args: Any*): String = { + (args map to_s mkString " ").replaceAll("""\s+$""", "") + } + def fname(sym: Symbol) = { + val p = "" + sym.owner.name + val x = if (sym.owner.isPackageClass || sym.owner.isModuleClass || sym.owner.isTerm) "." else "#" + sym.kindString + " " + p + x + sym.name + } + + def permuteAsSeenFrom(targs: List[Type]) = ( + for { + tp <- typeRefs(targs filterNot (_ eq NoType)) + prefix <- asSeenPrefixes + if tp.prefix != prefix + site <- classes + seen = tp.asSeenFrom(prefix, site) + if tp != seen + if !seen.isInstanceOf[ExistentialType] + } + yield ((site, tp, prefix, seen)) + ) + + def block(label: Any)(lines: List[String]): List[String] = { + val first = "" + label + " {" + val last = "}" + + first +: lines.map(" " + _) :+ last + } + + def permute(targs: List[Type]): List[String] = { + permuteAsSeenFrom(targs).groupBy(_._1).toList.sortBy(_._1.toString) flatMap { + case (site, xs) => + block(fmt(site)) { + fmt("type", "seen from prefix", "is") :: + fmt("----", "----------------", "--") :: { + xs.groupBy(_._2).toList.sortBy(_._1.toString) flatMap { + case (tp, ys) => + (ys map { case (_, _, prefix, seen) => fmt(tp, prefix, seen) }).sorted.distinct + } + } + } + } + } + } + + def pretty(xs: List[_]) = if (xs.isEmpty) "" else xs.mkString("\n ", "\n ", "\n") + + def signaturesIn(info: Type): List[String] = ( + info.members + filterNot (s => s.isType || s.owner == ObjectClass || s.owner == AnyClass || s.isConstructor) + map (_.defString) + ) + + def check(source: String, unit: global.CompilationUnit) = { + import syms._ + + afterTyper { + val typeArgs = List[Type](IntClass.tpe, ListClass[Int]) ++ tparams.map(_.tpe) + permute(typeArgs) foreach println + } + for (x <- classes ++ terms) { + afterEachPhase(signaturesIn(x.tpe)) collect { + case (ph, sigs) if sigs.nonEmpty => + println(sigs.mkString(x + " { // after " + ph + "\n ", "\n ", "\n}\n")) + } + } + true + } +} diff --git a/test/files/run/ctries/concmap.scala b/test/files/run/ctries/concmap.scala index d73e33182a..bf8cc9d12f 100644 --- a/test/files/run/ctries/concmap.scala +++ b/test/files/run/ctries/concmap.scala @@ -1,7 +1,7 @@ -import collection.mutable.Ctrie +import collection.mutable.ConcurrentTrieMap object ConcurrentMapSpec extends Spec { @@ -11,13 +11,13 @@ object ConcurrentMapSpec extends Spec { def test() { "support put" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until initsz) assert(ct.put(new Wrap(i), i) == None) for (i <- 0 until initsz) assert(ct.put(new Wrap(i), -i) == Some(i)) } "support put if absent" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until initsz) ct.update(new Wrap(i), i) for (i <- 0 until initsz) assert(ct.putIfAbsent(new Wrap(i), -i) == Some(i)) for (i <- 0 until initsz) assert(ct.putIfAbsent(new Wrap(i), -i) == Some(i)) @@ -26,7 +26,7 @@ object ConcurrentMapSpec extends Spec { } "support remove if mapped to a specific value" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until initsz) ct.update(new Wrap(i), i) for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), -i - 1) == false) for (i <- 0 until initsz) assert(ct.remove(new Wrap(i), i) == true) @@ -34,7 +34,7 @@ object ConcurrentMapSpec extends Spec { } "support replace if mapped to a specific value" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until initsz) ct.update(new Wrap(i), i) for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), -i - 1, -i - 2) == false) for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i, -i - 2) == true) @@ -43,7 +43,7 @@ object ConcurrentMapSpec extends Spec { } "support replace if present" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until initsz) ct.update(new Wrap(i), i) for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), -i) == Some(i)) for (i <- 0 until initsz) assert(ct.replace(new Wrap(i), i) == Some(-i)) @@ -56,7 +56,7 @@ object ConcurrentMapSpec extends Spec { } "support replace if mapped to a specific value, using several threads" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val sz = 55000 for (i <- 0 until sz) ct.update(new Wrap(i), i) @@ -89,7 +89,7 @@ object ConcurrentMapSpec extends Spec { } "support put if absent, several threads" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val sz = 110000 class Updater(offs: Int) extends Thread { @@ -110,7 +110,7 @@ object ConcurrentMapSpec extends Spec { } "support remove if mapped to a specific value, several threads" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val sz = 55000 for (i <- 0 until sz) ct.update(new Wrap(i), i) @@ -132,7 +132,7 @@ object ConcurrentMapSpec extends Spec { } "have all or none of the elements depending on the oddity" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val sz = 65000 for (i <- 0 until sz) ct(new Wrap(i)) = i @@ -165,7 +165,7 @@ object ConcurrentMapSpec extends Spec { } "compute size correctly" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val sz = 36450 for (i <- 0 until sz) ct(new Wrap(i)) = i @@ -174,7 +174,7 @@ object ConcurrentMapSpec extends Spec { } "compute size correctly in parallel" in { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] val sz = 36450 for (i <- 0 until sz) ct(new Wrap(i)) = i val pct = ct.par diff --git a/test/files/run/ctries/iterator.scala b/test/files/run/ctries/iterator.scala index 85a6ab7623..dbfab6b8a9 100644 --- a/test/files/run/ctries/iterator.scala +++ b/test/files/run/ctries/iterator.scala @@ -3,7 +3,7 @@ import collection._ -import collection.mutable.Ctrie +import collection.mutable.ConcurrentTrieMap @@ -11,7 +11,7 @@ object IteratorSpec extends Spec { def test() { "work for an empty trie" in { - val ct = new Ctrie + val ct = new ConcurrentTrieMap val it = ct.iterator it.hasNext shouldEqual (false) @@ -19,7 +19,7 @@ object IteratorSpec extends Spec { } def nonEmptyIteratorCheck(sz: Int) { - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct.put(new Wrap(i), i) val it = ct.iterator @@ -84,7 +84,7 @@ object IteratorSpec extends Spec { } def nonEmptyCollideCheck(sz: Int) { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until sz) ct.put(new DumbHash(i), i) val it = ct.iterator @@ -144,7 +144,7 @@ object IteratorSpec extends Spec { val W = 15 val S = 5 val checks = 5 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct.put(new Wrap(i), i) class Modifier extends Thread { @@ -156,7 +156,7 @@ object IteratorSpec extends Spec { } } - def consistentIteration(ct: Ctrie[Wrap, Int], checks: Int) { + def consistentIteration(ct: ConcurrentTrieMap[Wrap, Int], checks: Int) { class Iter extends Thread { override def run() { val snap = ct.readOnlySnapshot() @@ -185,7 +185,7 @@ object IteratorSpec extends Spec { val sgroupsize = 10 val sgroupnum = 5 val removerslowdown = 50 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct.put(new Wrap(i), i) class Remover extends Thread { @@ -227,7 +227,7 @@ object IteratorSpec extends Spec { val sgroupsize = 10 val sgroupnum = 10 val inserterslowdown = 50 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] class Inserter extends Thread { override def run() { @@ -265,7 +265,7 @@ object IteratorSpec extends Spec { "work on a yet unevaluated snapshot" in { val sz = 50000 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct.update(new Wrap(i), i) val snap = ct.snapshot() @@ -276,7 +276,7 @@ object IteratorSpec extends Spec { "be duplicated" in { val sz = 50 - val ct = collection.parallel.mutable.ParCtrie((0 until sz) zip (0 until sz): _*) + val ct = collection.parallel.mutable.ParConcurrentTrieMap((0 until sz) zip (0 until sz): _*) val it = ct.splitter for (_ <- 0 until (sz / 2)) it.next() val dupit = it.dup diff --git a/test/files/run/ctries/lnode.scala b/test/files/run/ctries/lnode.scala index 88cbeed1f6..e480795956 100644 --- a/test/files/run/ctries/lnode.scala +++ b/test/files/run/ctries/lnode.scala @@ -1,7 +1,7 @@ -import collection.mutable.Ctrie +import collection.mutable.ConcurrentTrieMap object LNodeSpec extends Spec { @@ -11,19 +11,19 @@ object LNodeSpec extends Spec { def test() { "accept elements with the same hash codes" in { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until initsz) ct.update(new DumbHash(i), i) } "lookup elements with the same hash codes" in { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until initsz) ct.update(new DumbHash(i), i) for (i <- 0 until initsz) assert(ct.get(new DumbHash(i)) == Some(i)) for (i <- initsz until secondsz) assert(ct.get(new DumbHash(i)) == None) } "remove elements with the same hash codes" in { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until initsz) ct.update(new DumbHash(i), i) for (i <- 0 until initsz) { val remelem = ct.remove(new DumbHash(i)) @@ -33,7 +33,7 @@ object LNodeSpec extends Spec { } "put elements with the same hash codes if absent" in { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until initsz) ct.put(new DumbHash(i), i) for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == i) for (i <- 0 until initsz) assert(ct.putIfAbsent(new DumbHash(i), i) == Some(i)) @@ -42,7 +42,7 @@ object LNodeSpec extends Spec { } "replace elements with the same hash codes" in { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until initsz) assert(ct.put(new DumbHash(i), i) == None) for (i <- 0 until initsz) assert(ct.lookup(new DumbHash(i)) == i) for (i <- 0 until initsz) assert(ct.replace(new DumbHash(i), -i) == Some(i)) @@ -51,7 +51,7 @@ object LNodeSpec extends Spec { } "remove elements with the same hash codes if mapped to a specific value" in { - val ct = new Ctrie[DumbHash, Int] + val ct = new ConcurrentTrieMap[DumbHash, Int] for (i <- 0 until initsz) assert(ct.put(new DumbHash(i), i) == None) for (i <- 0 until initsz) assert(ct.remove(new DumbHash(i), i) == true) } diff --git a/test/files/run/ctries/snapshot.scala b/test/files/run/ctries/snapshot.scala index 69073d3f06..3c816130b3 100644 --- a/test/files/run/ctries/snapshot.scala +++ b/test/files/run/ctries/snapshot.scala @@ -3,7 +3,7 @@ import collection._ -import collection.mutable.Ctrie +import collection.mutable.ConcurrentTrieMap @@ -11,11 +11,11 @@ object SnapshotSpec extends Spec { def test() { "support snapshots" in { - val ctn = new Ctrie + val ctn = new ConcurrentTrieMap ctn.snapshot() ctn.readOnlySnapshot() - val ct = new Ctrie[Int, Int] + val ct = new ConcurrentTrieMap[Int, Int] for (i <- 0 until 100) ct.put(i, i) ct.snapshot() ct.readOnlySnapshot() @@ -24,7 +24,7 @@ object SnapshotSpec extends Spec { "empty 2 quiescent snapshots in isolation" in { val sz = 4000 - class Worker(trie: Ctrie[Wrap, Int]) extends Thread { + class Worker(trie: ConcurrentTrieMap[Wrap, Int]) extends Thread { override def run() { for (i <- 0 until sz) { assert(trie.remove(new Wrap(i)) == Some(i)) @@ -35,7 +35,7 @@ object SnapshotSpec extends Spec { } } - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct.put(new Wrap(i), i) val snapt = ct.snapshot() @@ -96,7 +96,7 @@ object SnapshotSpec extends Spec { } // traverses the trie `rep` times and modifies each entry - class Modifier(trie: Ctrie[Wrap, Int], index: Int, rep: Int, sz: Int) extends Thread { + class Modifier(trie: ConcurrentTrieMap[Wrap, Int], index: Int, rep: Int, sz: Int) extends Thread { setName("Modifier %d".format(index)) override def run() { @@ -110,7 +110,7 @@ object SnapshotSpec extends Spec { } // removes all the elements from the trie - class Remover(trie: Ctrie[Wrap, Int], index: Int, totremovers: Int, sz: Int) extends Thread { + class Remover(trie: ConcurrentTrieMap[Wrap, Int], index: Int, totremovers: Int, sz: Int) extends Thread { setName("Remover %d".format(index)) override def run() { @@ -123,7 +123,7 @@ object SnapshotSpec extends Spec { val N = 100 val W = 10 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct(new Wrap(i)) = i val readonly = ct.readOnlySnapshot() val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) @@ -141,7 +141,7 @@ object SnapshotSpec extends Spec { val W = 100 val S = 5000 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct(new Wrap(i)) = i val threads = for (i <- 0 until W) yield new Remover(ct, i, W, sz) @@ -156,7 +156,7 @@ object SnapshotSpec extends Spec { val W = 10 val S = 7000 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct(new Wrap(i)) = i val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) @@ -165,7 +165,7 @@ object SnapshotSpec extends Spec { threads.foreach(_.join()) } - def consistentNonReadOnly(name: String, trie: Ctrie[Wrap, Int], sz: Int, N: Int) { + def consistentNonReadOnly(name: String, trie: ConcurrentTrieMap[Wrap, Int], sz: Int, N: Int) { @volatile var e: Exception = null // reads possible entries once and stores them @@ -223,7 +223,7 @@ object SnapshotSpec extends Spec { val W = 10 val S = 400 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct(new Wrap(i)) = i val threads = for (i <- 0 until W) yield new Modifier(ct, i, N, sz) @@ -241,7 +241,7 @@ object SnapshotSpec extends Spec { val S = 10 val modifytimes = 1200 val snaptimes = 600 - val ct = new Ctrie[Wrap, Int] + val ct = new ConcurrentTrieMap[Wrap, Int] for (i <- 0 until sz) ct(new Wrap(i)) = i class Snapshooter extends Thread { diff --git a/test/files/run/existentials-in-compiler.scala b/test/files/run/existentials-in-compiler.scala index e4f6920145..8c04e4782c 100644 --- a/test/files/run/existentials-in-compiler.scala +++ b/test/files/run/existentials-in-compiler.scala @@ -6,7 +6,7 @@ object Test extends CompilerTest { import global._ import definitions._ - def code = """ + override def code = """ package extest { trait Bippy[A <: AnyRef, B] { } // wildcards trait BippyLike[A <: AnyRef, B <: List[A], This <: BippyLike[A, B, This] with Bippy[A, B]] // no wildcards diff --git a/test/files/run/existentials3.check b/test/files/run/existentials3.check index 41dc1f767c..36a458dacc 100644 --- a/test/files/run/existentials3.check +++ b/test/files/run/existentials3.check @@ -1,22 +1,22 @@ -_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.ScalaObject with scala.Product with scala.Serializable] with scala.ScalaObject with scala.Serializable with java.lang.Object -_ <: Object with Test$ToS with scala.ScalaObject with scala.Product with scala.Serializable -Object with Test$ToS with scala.ScalaObject -Object with Test$ToS with scala.ScalaObject -Object with Test$ToS with scala.ScalaObject -scala.Function0[Object with Test$ToS with scala.ScalaObject] -scala.Function0[Object with Test$ToS with scala.ScalaObject] -_ <: Object with _ <: Object with Object with Test$ToS with scala.ScalaObject -_ <: Object with _ <: Object with _ <: Object with Test$ToS with scala.ScalaObject -scala.collection.immutable.List[Object with scala.collection.Seq[Int] with scala.ScalaObject] -scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int] with scala.ScalaObject] -_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.ScalaObject with scala.Product with scala.Serializable] with scala.ScalaObject with scala.Serializable with java.lang.Object -_ <: Object with Test$ToS with scala.ScalaObject with scala.Product with scala.Serializable -Object with Test$ToS with scala.ScalaObject -Object with Test$ToS with scala.ScalaObject -Object with Test$ToS with scala.ScalaObject -scala.Function0[Object with Test$ToS with scala.ScalaObject] -scala.Function0[Object with Test$ToS with scala.ScalaObject] -_ <: Object with _ <: Object with Object with Test$ToS with scala.ScalaObject -_ <: Object with _ <: Object with _ <: Object with Test$ToS with scala.ScalaObject -scala.collection.immutable.List[Object with scala.collection.Seq[Int] with scala.ScalaObject] -scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int] with scala.ScalaObject] +_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with Test$ToS with scala.Product with scala.Serializable +Object with Test$ToS +Object with Test$ToS +Object with Test$ToS +scala.Function0[Object with Test$ToS] +scala.Function0[Object with Test$ToS] +_ <: Object with _ <: Object with Object with Test$ToS +_ <: Object with _ <: Object with _ <: Object with Test$ToS +scala.collection.immutable.List[Object with scala.collection.Seq[Int]] +scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] +_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with Test$ToS with scala.Product with scala.Serializable +Object with Test$ToS +Object with Test$ToS +Object with Test$ToS +scala.Function0[Object with Test$ToS] +scala.Function0[Object with Test$ToS] +_ <: Object with _ <: Object with Object with Test$ToS +_ <: Object with _ <: Object with _ <: Object with Test$ToS +scala.collection.immutable.List[Object with scala.collection.Seq[Int]] +scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] diff --git a/test/files/run/genericValueClass.check b/test/files/run/genericValueClass.check new file mode 100644 index 0000000000..ec3a41a6a9 --- /dev/null +++ b/test/files/run/genericValueClass.check @@ -0,0 +1,2 @@ +(1,abc) +(2,def) diff --git a/test/files/run/genericValueClass.scala b/test/files/run/genericValueClass.scala new file mode 100644 index 0000000000..68162bb685 --- /dev/null +++ b/test/files/run/genericValueClass.scala @@ -0,0 +1,17 @@ +final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal { + @inline def -> [B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y) + def →[B](y: B): Tuple2[A, B] = ->(y) +} + +object Test extends App { + { + @inline implicit def any2ArrowAssoc[A](x: A): ArrowAssoc[A] = new ArrowAssoc(x) + val x = 1 -> "abc" + println(x) + } + + { + val y = 2 -> "def" + println(y) + } +} diff --git a/test/files/run/matchonseq.check b/test/files/run/matchonseq.check new file mode 100644 index 0000000000..3fe554095a --- /dev/null +++ b/test/files/run/matchonseq.check @@ -0,0 +1,2 @@ +It worked! head=1 +It worked! last=3 diff --git a/test/files/run/matchonseq.scala b/test/files/run/matchonseq.scala new file mode 100644 index 0000000000..49b406a6ec --- /dev/null +++ b/test/files/run/matchonseq.scala @@ -0,0 +1,8 @@ +object Test extends App{ + Vector(1,2,3) match { + case head +: tail => println("It worked! head=" + head) + } + Vector(1,2,3) match { + case init :+ last => println("It worked! last=" + last) + } +} diff --git a/test/files/run/primitive-sigs-2.check b/test/files/run/primitive-sigs-2.check index c69d1b54a6..feb0619525 100644 --- a/test/files/run/primitive-sigs-2.check +++ b/test/files/run/primitive-sigs-2.check @@ -1,4 +1,4 @@ -T<java.lang.Object> interface scala.ScalaObject +T<java.lang.Object> List(A, char, class java.lang.Object) a public <T> java.lang.Object Arr.arr4(java.lang.Object[],scala.reflect.Manifest<T>) diff --git a/test/files/run/programmatic-main.check b/test/files/run/programmatic-main.check index 6f253f5de1..d16e2c5178 100644 --- a/test/files/run/programmatic-main.check +++ b/test/files/run/programmatic-main.check @@ -5,24 +5,26 @@ packageobjects 3 load package objects typer 4 the meat and potatoes: type the trees superaccessors 5 add super accessors in traits and nested classes - pickler 6 serialize symbol tables - refchecks 7 reference/override checking, translate nested objects - uncurry 8 uncurry, translate function values to anonymous classes - tailcalls 9 replace tail calls by jumps - specialize 10 @specialized-driven class and method specialization - explicitouter 11 this refs to outer pointers, translate patterns - erasure 12 erase types, add interfaces for traits - lazyvals 13 allocate bitmaps, translate lazy vals into lazified defs - lambdalift 14 move nested functions to top level - constructors 15 move field definitions into constructors - flatten 16 eliminate inner classes - mixin 17 mixin composition - cleanup 18 platform-specific cleanups, generate reflective calls - icode 19 generate portable intermediate code - inliner 20 optimization: do inlining -inlineExceptionHandlers 21 optimization: inline exception handlers - closelim 22 optimization: eliminate uncalled closures - dce 23 optimization: eliminate dead code - jvm 24 generate JVM bytecode - terminal 25 The last phase in the compiler chain + extmethods 6 add extension methods for inline classes + pickler 7 serialize symbol tables + refchecks 8 reference/override checking, translate nested objects + uncurry 9 uncurry, translate function values to anonymous classes + tailcalls 10 replace tail calls by jumps + specialize 11 @specialized-driven class and method specialization + explicitouter 12 this refs to outer pointers, translate patterns + erasure 13 erase types, add interfaces for traits + posterasure 14 clean up erased inline classes + lazyvals 15 allocate bitmaps, translate lazy vals into lazified defs + lambdalift 16 move nested functions to top level + constructors 17 move field definitions into constructors + flatten 18 eliminate inner classes + mixin 19 mixin composition + cleanup 20 platform-specific cleanups, generate reflective calls + icode 21 generate portable intermediate code + inliner 22 optimization: do inlining +inlineExceptionHandlers 23 optimization: inline exception handlers + closelim 24 optimization: eliminate uncalled closures + dce 25 optimization: eliminate dead code + jvm 26 generate JVM bytecode + terminal 27 The last phase in the compiler chain diff --git a/test/files/run/reify_ann1a.check b/test/files/run/reify_ann1a.check index 2822238706..97d4848a49 100644 --- a/test/files/run/reify_ann1a.check +++ b/test/files/run/reify_ann1a.check @@ -1,5 +1,5 @@ { - @new ann(immutable.this.List.apply[String]("1a")) @new ann(immutable.this.List.apply[String]("1b")) class C[@new ann(immutable.this.List.apply[String]("2a")) @new ann(immutable.this.List.apply[String]("2b")) T>: Nothing <: Any] extends Object with ScalaObject { + @new ann(immutable.this.List.apply[String]("1a")) @new ann(immutable.this.List.apply[String]("1b")) class C[@new ann(immutable.this.List.apply[String]("2a")) @new ann(immutable.this.List.apply[String]("2b")) T>: Nothing <: Any] extends scala.AnyRef { @new ann(immutable.this.List.apply[String]("3a")) @new ann(immutable.this.List.apply[String]("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply[String]("4a")) @ann(immutable.this.List.apply[String]("4b")) = _; def <init>(@new ann(immutable.this.List.apply[String]("3a")) @new ann(immutable.this.List.apply[String]("3b")) x: T @ann(immutable.this.List.apply[String]("4a")) @ann(immutable.this.List.apply[String]("4b"))) = { super.<init>(); @@ -14,7 +14,7 @@ () } { - @ann(immutable.this.List.apply[String]("1a")) @ann(immutable.this.List.apply[String]("1b")) class C[@ann(immutable.this.List.apply[String]("2a")) @ann(immutable.this.List.apply[String]("2b")) T>: Nothing <: Any] extends Object with ScalaObject { + @ann(immutable.this.List.apply[String]("1a")) @ann(immutable.this.List.apply[String]("1b")) class C[@ann(immutable.this.List.apply[String]("2a")) @ann(immutable.this.List.apply[String]("2b")) T>: Nothing <: Any] extends scala.AnyRef { @ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) <paramaccessor> private[this] val x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a")) = _; def <init>(@ann(immutable.this.List.apply[String]("3a")) @ann(immutable.this.List.apply[String]("3b")) x: T @ann(immutable.this.List.apply[String]("4b")) @ann(immutable.this.List.apply[String]("4a"))): C[T] = { C.super.<init>(); diff --git a/test/files/run/reify_ann1b.check b/test/files/run/reify_ann1b.check index e240e1e0ce..ceebc0e2ed 100644 --- a/test/files/run/reify_ann1b.check +++ b/test/files/run/reify_ann1b.check @@ -1,5 +1,5 @@ { - @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T>: Nothing <: Any] extends Object with ScalaObject { + @new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T>: Nothing <: Any] extends scala.AnyRef { @new ann(bar = "3a") @new ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _; def <init>(@new ann(bar = "3a") @new ann(bar = "3b") x: T @ann(bar = "4a") @ann(bar = "4b")) = { super.<init>(); @@ -14,7 +14,7 @@ () } { - @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T>: Nothing <: Any] extends Object with ScalaObject { + @ann(bar = "1a") @ann(bar = "1b") class C[@ann(bar = "2a") @ann(bar = "2b") T>: Nothing <: Any] extends scala.AnyRef { @ann(bar = "3a") @ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4b") @ann(bar = "4a") = _; def <init>(@ann(bar = "3a") @ann(bar = "3b") x: T @ann(bar = "4b") @ann(bar = "4a")): C[T] = { C.super.<init>(); diff --git a/test/files/run/reify_classfileann_a.check b/test/files/run/reify_classfileann_a.check index 1773263a94..419d916907 100644 --- a/test/files/run/reify_classfileann_a.check +++ b/test/files/run/reify_classfileann_a.check @@ -1,5 +1,5 @@ { - @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends Object with ScalaObject { + @new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends scala.AnyRef { def <init>() = { super.<init>(); () @@ -8,7 +8,7 @@ () } { - @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends Object with ScalaObject { + @ann(bar = "1", quux = ["2", "3"], baz = ann(bar = "4")) class C extends scala.AnyRef { def <init>(): C = { C.super.<init>(); () diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check index 944846541f..69f0a9ce30 100644 --- a/test/files/run/repl-parens.check +++ b/test/files/run/repl-parens.check @@ -66,7 +66,7 @@ scala> 55 ; () => 5 res13: () => Int = <function0> scala> () => { class X ; new X } -res14: () => Object with ScalaObject = <function0> +res14: () => Object = <function0> scala> diff --git a/test/files/run/t0663.check b/test/files/run/t0663.check index 22b68b7f57..dd9be2af70 100644..100755 --- a/test/files/run/t0663.check +++ b/test/files/run/t0663.check @@ -1 +1 @@ -<feed></feed> +<feed/> diff --git a/test/files/run/t1195.check b/test/files/run/t1195.check index dc521fb8ca..d023bc91f7 100644 --- a/test/files/run/t1195.check +++ b/test/files/run/t1195.check @@ -1,6 +1,6 @@ -_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.ScalaObject with scala.Product with scala.Serializable] with scala.ScalaObject with scala.Serializable with java.lang.Object -_ <: Object with scala.ScalaObject with scala.Product with scala.Serializable -Object with scala.ScalaObject with scala.Product with scala.Serializable -_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.ScalaObject with scala.Product with scala.Serializable] with scala.ScalaObject with scala.Serializable with java.lang.Object -_ <: Object with scala.ScalaObject with scala.Product with scala.Serializable -Object with scala.ScalaObject with scala.Product with scala.Serializable +_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with scala.Product with scala.Serializable +Object with scala.Product with scala.Serializable +_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object +_ <: Object with scala.Product with scala.Serializable +Object with scala.Product with scala.Serializable diff --git a/test/files/run/t1620.check b/test/files/run/t1620.check index 979efc8227..afa1e6acd5 100644..100755 --- a/test/files/run/t1620.check +++ b/test/files/run/t1620.check @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE foo PUBLIC "-//Foo Corp//DTD 1.0//EN" "foo.dtd"> -<foo></foo> +<foo/> <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE foo PUBLIC "-//Foo Corp//DTD 1.0//EN"> -<foo></foo> +<foo/> diff --git a/test/files/run/t2124.check b/test/files/run/t2124.check index 2b8840209f..51b40469aa 100644..100755 --- a/test/files/run/t2124.check +++ b/test/files/run/t2124.check @@ -1 +1 @@ -<p><lost></lost><q></q></p> +<p><lost/><q/></p> diff --git a/test/files/run/t2125.check b/test/files/run/t2125.check index 2b8840209f..51b40469aa 100644..100755 --- a/test/files/run/t2125.check +++ b/test/files/run/t2125.check @@ -1 +1 @@ -<p><lost></lost><q></q></p> +<p><lost/><q/></p> diff --git a/test/files/run/t4172.check b/test/files/run/t4172.check index 95e3eb950d..da467e27ea 100644 --- a/test/files/run/t4172.check +++ b/test/files/run/t4172.check @@ -4,7 +4,7 @@ Type :help for more information. scala> scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) } -c: (C, C{def f: Int}) forSome { type C <: Object with ScalaObject } = (C,C) +c: (C, C{def f: Int}) forSome { type C <: Object } = (C,C) scala> diff --git a/test/files/run/t4891.check b/test/files/run/t4891.check index 072f8df8d4..79fd7f6fbb 100644 --- a/test/files/run/t4891.check +++ b/test/files/run/t4891.check @@ -5,4 +5,3 @@ test.generic.C1 test.generic.C2 (m) public void test.generic.C1.m1() null -interface scala.ScalaObject diff --git a/test/files/run/t5224.check b/test/files/run/t5224.check index 5bead91b36..28bc75d4fd 100644 --- a/test/files/run/t5224.check +++ b/test/files/run/t5224.check @@ -1,5 +1,5 @@ { - @new Foo(bar = "qwe") class C extends Object with ScalaObject { + @new Foo(bar = "qwe") class C extends scala.AnyRef { def <init>() = { super.<init>(); () diff --git a/test/files/run/t5271_1.check b/test/files/run/t5271_1.check index d4fd544e88..9b956da17a 100644 --- a/test/files/run/t5271_1.check +++ b/test/files/run/t5271_1.check @@ -1,5 +1,5 @@ { - case class C extends Object with ScalaObject with Product with Serializable { + case class C extends Object with Product with Serializable { <caseaccessor> <paramaccessor> val foo : Int = _; <caseaccessor> <paramaccessor> val bar : Int = _; def <init>(foo: Int, bar: Int) = { diff --git a/test/files/run/t5271_2.check b/test/files/run/t5271_2.check index 5a519f265f..27297febb6 100644 --- a/test/files/run/t5271_2.check +++ b/test/files/run/t5271_2.check @@ -1,5 +1,5 @@ { - case class C extends Object with ScalaObject with Product with Serializable { + case class C extends Object with Product with Serializable { <caseaccessor> <paramaccessor> val foo : Int = _; <caseaccessor> <paramaccessor> val bar : Int = _; def <init>(foo: Int, bar: Int) = { diff --git a/test/files/run/t5271_3.check b/test/files/run/t5271_3.check index be87696f02..9331c78959 100644 --- a/test/files/run/t5271_3.check +++ b/test/files/run/t5271_3.check @@ -1,12 +1,12 @@ { - object C extends Object with ScalaObject with Serializable { + object C extends scala.AnyRef with Serializable { def <init>() = { super.<init>(); () }; def qwe: Int = 4 }; - case class C extends Object with ScalaObject with Product with Serializable { + case class C extends Object with Product with Serializable { <caseaccessor> <paramaccessor> val foo : Int = _; <caseaccessor> <paramaccessor> val bar : Int = _; def <init>(foo: Int, bar: Int) = { diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check index 4a8a9ce602..bb13928fd8 100644 --- a/test/files/run/t5527.check +++ b/test/files/run/t5527.check @@ -1,13 +1,13 @@ [[syntax trees at end of parser]]// Scala source: newSource1 package <empty> { - object UselessComments extends scala.ScalaObject { + object UselessComments extends scala.AnyRef { def <init>() = { super.<init>(); () }; var z = 0; def test1 = { - object Maybe extends scala.ScalaObject { + object Maybe extends scala.AnyRef { def <init>() = { super.<init>(); () @@ -42,13 +42,13 @@ package <empty> { } }; /** comments that we should keep */ - object UsefulComments extends scala.ScalaObject { + object UsefulComments extends scala.AnyRef { def <init>() = { super.<init>(); () }; /** class A */ - class A extends scala.ScalaObject { + class A extends scala.AnyRef { def <init>() = { super.<init>(); () @@ -61,7 +61,7 @@ package <empty> { var u = 2 }; /** trait B */ - abstract trait B extends scala.ScalaObject { + abstract trait B extends scala.AnyRef { def $init$() = { () }; @@ -75,7 +75,7 @@ package <empty> { var u = 2 }; /** object C */ - object C extends scala.ScalaObject { + object C extends scala.AnyRef { def <init>() = { super.<init>(); () @@ -88,7 +88,7 @@ package <empty> { var u = 2 }; /** class D */ - @new deprecated("use ... instead", "2.10.0") class D extends scala.ScalaObject { + @new deprecated("use ... instead", "2.10.0") class D extends scala.AnyRef { def <init>() = { super.<init>(); () diff --git a/test/files/run/valueclasses-constr.check b/test/files/run/valueclasses-constr.check new file mode 100644 index 0000000000..df37fbc723 --- /dev/null +++ b/test/files/run/valueclasses-constr.check @@ -0,0 +1,2 @@ +0 +00:16:40 diff --git a/test/files/run/valueclasses-constr.scala b/test/files/run/valueclasses-constr.scala new file mode 100644 index 0000000000..7a10299386 --- /dev/null +++ b/test/files/run/valueclasses-constr.scala @@ -0,0 +1,25 @@ +object TOD { + final val SecondsPerDay = 86400 + + def apply(seconds: Int) = { + val n = seconds % SecondsPerDay + new TOD(if (n >= 0) n else n + SecondsPerDay) + } +} + +final class TOD (val secondsOfDay: Int) extends AnyVal { + def hours = secondsOfDay / 3600 + def minutes = (secondsOfDay / 60) % 60 + def seconds = secondsOfDay % 60 + + override def toString = "%02d:%02d:%02d".format(hours, minutes, seconds) +} + +object Test extends App { + + val y: TOD = new TOD(1000) + val x: TOD = TOD(1000) + println(x.hours) + println(x) +} + diff --git a/test/files/run/xml-attribute.check b/test/files/run/xml-attribute.check index 3ae2034684..3cfe3779fc 100644 --- a/test/files/run/xml-attribute.check +++ b/test/files/run/xml-attribute.check @@ -1,12 +1,12 @@ -<t></t> -<t></t> -<t></t> -<t></t> -<t></t> -<t b="1" d="2"></t> -<t b="1" d="2"></t> -<t b="1" d="2"></t> -<t a="1" d="2"></t> -<t b="1" d="2"></t> -<t a="1" b="2" c="3"></t> -<t g="1" e="2" p:a="3" f:e="4" mgruhu:ji="5"></t>
\ No newline at end of file +<t/> +<t/> +<t/> +<t/> +<t/> +<t b="1" d="2"/> +<t b="1" d="2"/> +<t b="1" d="2"/> +<t a="1" d="2"/> +<t b="1" d="2"/> +<t a="1" b="2" c="3"/> +<t g="1" e="2" p:a="3" f:e="4" mgruhu:ji="5"/> |