From 10830eaae2955766378369b8d1bcc0e6963b9b7f Mon Sep 17 00:00:00 2001 From: Antonio Cunei Date: Fri, 15 May 2009 15:44:54 +0000 Subject: 1.4-related cleanup and reorganization. Removed a bunch of now useless 1.4 code, merged back jvm5-specific partest tests into the general jvm tests, documentation updates. --- test/files/jvm5/NestedAnnotations.java | 25 --- test/files/jvm5/OuterEnum.java | 5 - test/files/jvm5/OuterTParams.java | 6 - test/files/jvm5/SourceAnnotation.java | 9 - test/files/jvm5/annotations.check | 35 --- test/files/jvm5/annotations.scala | 159 -------------- test/files/jvm5/bug676.check | 1 - test/files/jvm5/bug676.scala | 8 - test/files/jvm5/bug680.check | 0 test/files/jvm5/bug680.scala | 6 - test/files/jvm5/console.check | 3 - test/files/jvm5/console.scala | 14 -- test/files/jvm5/genericNest.scala | 13 -- test/files/jvm5/interpreter.check | 218 ------------------- test/files/jvm5/interpreter.scala | 179 --------------- test/files/jvm5/mkAnnotationsJar.sh | 29 --- test/files/jvm5/outerEnum.check | 1 - test/files/jvm5/outerEnum.scala | 9 - test/files/jvm5/stringbuilder.scala | 100 --------- test/files/jvm5/sync-var.check | 1 - test/files/jvm5/sync-var.scala | 53 ----- test/files/jvm5/t0014.check | 1 - test/files/jvm5/t0014.scala | 5 - test/files/jvm5/t1461.scala | 18 -- test/files/jvm5/t1464.check | 1 - test/files/jvm5/t1464/MyTrait.scala | 5 - test/files/jvm5/t1464/Test.java | 6 - test/files/jvm5/throws-annot.check | 21 -- test/files/jvm5/throws-annot.scala | 74 ------- test/files/jvm5/typerep.check | 49 ----- test/files/jvm5/typerep.scala | 383 --------------------------------- 31 files changed, 1437 deletions(-) delete mode 100644 test/files/jvm5/NestedAnnotations.java delete mode 100644 test/files/jvm5/OuterEnum.java delete mode 100644 test/files/jvm5/OuterTParams.java delete mode 100644 test/files/jvm5/SourceAnnotation.java delete mode 100644 test/files/jvm5/annotations.check delete mode 100644 test/files/jvm5/annotations.scala delete mode 100644 test/files/jvm5/bug676.check delete mode 100644 test/files/jvm5/bug676.scala delete mode 100644 test/files/jvm5/bug680.check delete mode 100644 test/files/jvm5/bug680.scala delete mode 100644 test/files/jvm5/console.check delete mode 100644 test/files/jvm5/console.scala delete mode 100644 test/files/jvm5/genericNest.scala delete mode 100644 test/files/jvm5/interpreter.check delete mode 100644 test/files/jvm5/interpreter.scala delete mode 100755 test/files/jvm5/mkAnnotationsJar.sh delete mode 100644 test/files/jvm5/outerEnum.check delete mode 100644 test/files/jvm5/outerEnum.scala delete mode 100644 test/files/jvm5/stringbuilder.scala delete mode 100644 test/files/jvm5/sync-var.check delete mode 100644 test/files/jvm5/sync-var.scala delete mode 100644 test/files/jvm5/t0014.check delete mode 100644 test/files/jvm5/t0014.scala delete mode 100644 test/files/jvm5/t1461.scala delete mode 100644 test/files/jvm5/t1464.check delete mode 100644 test/files/jvm5/t1464/MyTrait.scala delete mode 100644 test/files/jvm5/t1464/Test.java delete mode 100644 test/files/jvm5/throws-annot.check delete mode 100644 test/files/jvm5/throws-annot.scala delete mode 100755 test/files/jvm5/typerep.check delete mode 100755 test/files/jvm5/typerep.scala (limited to 'test/files/jvm5') diff --git a/test/files/jvm5/NestedAnnotations.java b/test/files/jvm5/NestedAnnotations.java deleted file mode 100644 index 8f2327dcce..0000000000 --- a/test/files/jvm5/NestedAnnotations.java +++ /dev/null @@ -1,25 +0,0 @@ -package test; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -public class NestedAnnotations { - - @OuterAnno(inner=@InnerAnno(name="inner")) - String field; - - @Target({FIELD}) - @Retention(RUNTIME) - public static @interface InnerAnno { - String name(); - } - - @Target({FIELD}) - @Retention(RUNTIME) - public static @interface OuterAnno { - InnerAnno inner(); - } -} diff --git a/test/files/jvm5/OuterEnum.java b/test/files/jvm5/OuterEnum.java deleted file mode 100644 index 75d3f34223..0000000000 --- a/test/files/jvm5/OuterEnum.java +++ /dev/null @@ -1,5 +0,0 @@ -package enums; - -public class OuterEnum { - public enum Foo { Bar } -} diff --git a/test/files/jvm5/OuterTParams.java b/test/files/jvm5/OuterTParams.java deleted file mode 100644 index 1d3db49fcf..0000000000 --- a/test/files/jvm5/OuterTParams.java +++ /dev/null @@ -1,6 +0,0 @@ -public class OuterTParams { - class InnerClass { - // Cannot parse method signature: "()TA;" - public A method() { return null; } - } -} diff --git a/test/files/jvm5/SourceAnnotation.java b/test/files/jvm5/SourceAnnotation.java deleted file mode 100644 index 047751ddfe..0000000000 --- a/test/files/jvm5/SourceAnnotation.java +++ /dev/null @@ -1,9 +0,0 @@ -package test; - -import java.lang.annotation.*; - -@Retention(value=RetentionPolicy.RUNTIME) -public @interface SourceAnnotation { - public String value(); - public String[] mails() default { "bill.gates@bloodsuckers.com" }; -} diff --git a/test/files/jvm5/annotations.check b/test/files/jvm5/annotations.check deleted file mode 100644 index 418301331f..0000000000 --- a/test/files/jvm5/annotations.check +++ /dev/null @@ -1,35 +0,0 @@ -class java.rmi.RemoteException -class java.io.IOException -@java.lang.Deprecated() -@test.SourceAnnotation(mails={scala@lists.epfl.ch,scala-lounge@lists.epfl.ch}, value=http://scala-lang.org) -class Test4$Foo1 - -@test.SourceAnnotation(mails={you@bloodsuckers.com}, value=http://bloodsuckers.com) -class Test4$Foo2 - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=http://bloodsuckers.com) -class Test4$Foo3 - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/null) -private final int Test4$Foo4.x - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/null) -public int Test4$Foo4.x() - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=file:///dev/zero) -public int Test4$Foo5.bar() - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=primary constructor) -public Test4$Foo6(java.lang.String) - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=secondary constructor) -public Test4$Foo7() - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=constructor val) -private final int Test4$Foo8.n - -@test.SourceAnnotation(mails={bill.gates@bloodsuckers.com}, value=constructor val) -public int Test4$Foo8.n() - -0 -99 diff --git a/test/files/jvm5/annotations.scala b/test/files/jvm5/annotations.scala deleted file mode 100644 index 9af2d333ba..0000000000 --- a/test/files/jvm5/annotations.scala +++ /dev/null @@ -1,159 +0,0 @@ -object Test1 { - class Foo { - @remote - def foo: Unit = () - } - def run { - val method = classOf[Foo].getMethod("foo") - method.getExceptionTypes foreach println - } -} - -object Test2 { - import java.io.{BufferedReader,FileReader, IOException} - class Reader(fname: String) { - private val in = new BufferedReader(new FileReader(fname)) - - @throws(classOf[IOException]) - def read() = in.read() - } - def run { - val method = classOf[Reader].getMethod("read") - method.getExceptionTypes foreach println - } -} - -/* Java: -public class Main { - @Deprecated - public void foo() {} - public static void main(String[] args) throws Exception { - Method method = Class.forName("test.Main").getMethod("foo", new Class[]{}); - Annotation annotation = method.getAnnotation(Deprecated.class); - System.out.println(annotation); // @java.lang.Deprecated() - } -} -*/ -object Test3 { - import java.lang.Deprecated - class Foo { - @Deprecated - def foo: Unit = () - } - def run { - val method = classOf[Foo].getMethod("foo") - val annotation = method.getAnnotation(classOf[Deprecated]) - println(annotation) - } -} - -/* Java: -@Retention(value=RetentionPolicy.RUNTIME) -@interface Source { - public String url(); - public String mail(); -} -@Source(url="http://scala.epfl.ch", mail="scala@lists.epfl.ch") -class Foo {} -public class Main { - public static void main(String[] args) throws Exception { - Class clazz = Class.forName("test.Foo"); - Annotation[] annotations = clazz.getAnnotations(); - for (int i = 0; i < annotations.length; i++) - System.out.println(annotations[i]); - // @test.Main$Source(url=http://scala-lang.org, mail=scala@lists.epfl.ch) - } -} -*/ -object Test4 { - import test.SourceAnnotation // defined in SourceAnnotation.java - @SourceAnnotation{val value = "http://scala-lang.org", - val mails = Array("scala@lists.epfl.ch", "scala-lounge@lists.epfl.ch")} - class Foo1 - @SourceAnnotation("http://bloodsuckers.com") { val mails = Array("you@bloodsuckers.com") } - class Foo2 - @SourceAnnotation("http://bloodsuckers.com") - class Foo3 - class Foo4 { - @SourceAnnotation("file:///dev/null") - val x = 1 - } - class Foo5 { - @SourceAnnotation("file:///dev/zero") - def bar: Int = 0 - } - class Foo6 @SourceAnnotation("primary constructor")(s: String) { - // to guarantee that primary constructor annotations - // are not applied to secondary constructors - def this() = this("") - } - class Foo7(s: String) { - @SourceAnnotation("secondary constructor") - def this() = this("") - } - class Foo8(@SourceAnnotation("constructor val") val n: Int) {} - def run { - import java.lang.annotation.Annotation - import java.lang.reflect.AnnotatedElement - def printSourceAnnotations(target: AnnotatedElement) { - //print SourceAnnotation in a predefined way to insure - // against difference in the JVMs (e.g. Sun's vs IBM's) - def printSourceAnnotation(a: Annotation) { - val ann = a.asInstanceOf[SourceAnnotation] - println("@test.SourceAnnotation(mails=" + ann.mails.deepMkString("{", ",", "}") + - ", value=" + ann.value + ")") - } - val anns = target.getAnnotations() - anns foreach printSourceAnnotation - if (anns.length > 0) { - println(target) - println - } - } - printSourceAnnotations(classOf[Foo1]) - printSourceAnnotations(classOf[Foo2]) - printSourceAnnotations(classOf[Foo3]) - classOf[Foo4].getDeclaredFields foreach printSourceAnnotations - classOf[Foo4].getDeclaredMethods foreach printSourceAnnotations - classOf[Foo5].getDeclaredMethods foreach printSourceAnnotations - classOf[Foo6].getDeclaredConstructors foreach printSourceAnnotations - classOf[Foo7].getDeclaredConstructors foreach printSourceAnnotations - classOf[Foo8].getDeclaredFields foreach printSourceAnnotations - classOf[Foo8].getDeclaredMethods foreach printSourceAnnotations - } -} - -object Test5 { - import scala.reflect.BeanProperty - import java.lang.Integer - - class Count { - // we use "Integer" instead of "Int" because of Java reflection - @BeanProperty - private var count: Integer = 0 - - private val getter = - getClass().getMethod("getCount") - private val setter = - getClass().getMethod("setCount", classOf[Integer]) - - def get = getter.invoke(this).asInstanceOf[Integer].intValue - def set(n: Int) = setter.invoke(this, new Integer(n)) - } - def run { - val count = new Count - println(count.get) - count.set(99) - println(count.get) - } -} - -object Test { - def main(args: Array[String]) { - Test1.run - Test2.run - Test3.run // requires the use of -target:jvm-1.5 - Test4.run - Test5.run - } -} diff --git a/test/files/jvm5/bug676.check b/test/files/jvm5/bug676.check deleted file mode 100644 index 5d1c9925f9..0000000000 --- a/test/files/jvm5/bug676.check +++ /dev/null @@ -1 +0,0 @@ -RUNTIME diff --git a/test/files/jvm5/bug676.scala b/test/files/jvm5/bug676.scala deleted file mode 100644 index bcd27e4e21..0000000000 --- a/test/files/jvm5/bug676.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - def main(args: Array[String]): Unit = { - import java.lang.annotation.Retention; - val c = classOf[Retention] - val r: Retention = c.getAnnotation(c).asInstanceOf[Retention]; - Console.println(r.value) - } -} diff --git a/test/files/jvm5/bug680.check b/test/files/jvm5/bug680.check deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/files/jvm5/bug680.scala b/test/files/jvm5/bug680.scala deleted file mode 100644 index b0b0c9f7c0..0000000000 --- a/test/files/jvm5/bug680.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - def main(args:Array[String]) { - val sb = new java.lang.StringBuilder() // use Java 1.5 - sb.setLength(0) - } -} diff --git a/test/files/jvm5/console.check b/test/files/jvm5/console.check deleted file mode 100644 index ef7c169844..0000000000 --- a/test/files/jvm5/console.check +++ /dev/null @@ -1,3 +0,0 @@ -true11.0.. -1 -Argument nr. 1 has value 3.33 diff --git a/test/files/jvm5/console.scala b/test/files/jvm5/console.scala deleted file mode 100644 index b07765675c..0000000000 --- a/test/files/jvm5/console.scala +++ /dev/null @@ -1,14 +0,0 @@ - -/** Test scala.Console functionality. */ -object Test extends Application { - - import Console._ - print(true) - print(1) - print(1.0) - flush - println("..") - println(1) - printf("Argument nr. %d has value %1.2f\n", - 1, 10.0/3) -} diff --git a/test/files/jvm5/genericNest.scala b/test/files/jvm5/genericNest.scala deleted file mode 100644 index c1b0210117..0000000000 --- a/test/files/jvm5/genericNest.scala +++ /dev/null @@ -1,13 +0,0 @@ -/** found in genericNest.jar, compiled from OuterTParams.java */ -import nestpkg._; - -// bug #695 -object ForceParse extends OuterTParams[AnyRef] { - // Force import of HarderToParse.InnerClass, - // which has confusing method signature. - var field: InnerClass = null -} - -object Test extends Application { - ForceParse -} diff --git a/test/files/jvm5/interpreter.check b/test/files/jvm5/interpreter.check deleted file mode 100644 index 86d6adbbec..0000000000 --- a/test/files/jvm5/interpreter.check +++ /dev/null @@ -1,218 +0,0 @@ -Type in expressions to have them evaluated. -Type :help for more information. - -scala> -scala> -scala> res0: Int = 7 - -scala> | | | | gcd: (Int,Int)Int - -scala> five: Int = 5 - -scala> x: Int = 1 - -scala> x: Int = 2 - -scala> three: Int = 3 - -scala> defined type alias anotherint - -scala> four: anotherint = 4 - -scala> :5: error: type mismatch; - found : java.lang.String("hello") - required: anotherint - val bogus: anotherint = "hello" - ^ - -scala> defined trait PointlessTrait - -scala> x: Int = 2 -y: Int = 3 - -scala> hello - -scala> -scala> -scala> t1513: Array[Null] = Array(null) - -scala> -scala> atom: scala.xml.Atom[Unit] = () - -scala> -scala> defined class S - -scala> fish: S = fish - -scala> -scala> arr: Array[java.lang.String] = Array(What's, up, doc?) - -scala> -scala> arrInt: Any = Array(1, 2, 3) - -scala> -scala> arrArrInt: Any = Array(Array(1, 2), Array(3, 4)) - -scala> -scala> -scala> defined class Foo - -scala> defined class Bar - -scala> foo2bar: (Foo)Bar - -scala> bar: Bar = Bar(3) - -scala> -scala> -scala> import bar._ - -scala> m: Int = 3 - -scala> -scala> -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> one: Int = 1 - -scala> -scala> -scala> x1: Int = 1 - -scala> x2: Int = 1 - -scala> x3: Int = 1 - -scala> x4: Int = 1 - -scala> x5: Int = 1 - -scala> x6: Int = 1 - -scala> x7: Int = 1 - -scala> x8: Int = 1 - -scala> x9: Int = 1 - -scala> x10: Int = 1 - -scala> x11: Int = 1 - -scala> x12: Int = 1 - -scala> x13: Int = 1 - -scala> x14: Int = 1 - -scala> x15: Int = 1 - -scala> x16: Int = 1 - -scala> x17: Int = 1 - -scala> x18: Int = 1 - -scala> x19: Int = 1 - -scala> x20: Int = 1 - -scala> -scala> two: Int = 2 - -scala> -scala> -scala> -scala> -scala> :1: error: '=' expected but '=>' found. - def x => y => z - ^ - -scala> :1: error: expected start of definition - [1,2,3] - ^ - -scala> -scala> -scala> -scala> | | | | res3: scala.xml.Elem = - - - -scala> -scala> -scala> | | | | -scala> -scala> -scala> -scala> | | | res4: java.lang.String = - - hello - there - - -scala> -scala> | | You typed two blank lines. Starting a new command. - -scala> -scala> match: Int - -scala> x: Int = 1 - -scala> -scala> -scala> defined class Exp -defined class Fact -defined class Term - -scala> | | :15: warning: match is not exhaustive! -missing combination Term - - def f(e: Exp) = e match { // non-exhaustive warning here - ^ -f: (Exp)Int - -scala> -scala> -plusOne: (Int)Int -res0: Int = 6 -res0: java.lang.String = after reset -:5: error: not found: value plusOne - plusOne(5) // should be undefined now - ^ diff --git a/test/files/jvm5/interpreter.scala b/test/files/jvm5/interpreter.scala deleted file mode 100644 index 21c88734e0..0000000000 --- a/test/files/jvm5/interpreter.scala +++ /dev/null @@ -1,179 +0,0 @@ -import scala.tools.nsc._ -import java.io.{BufferedReader, StringReader, PrintWriter, - Writer, OutputStreamWriter} - -object Test { - val testCodeString = -// basics -3+4 -def gcd(x: Int, y: Int): Int = {{ - if (x == 0) y - else if (y == 0) x - else gcd(y%x, x) -}} -val five = gcd(15,35) -var x = 1 -x = 2 -val three = x+1 -type anotherint = Int -val four: anotherint = 4 -val bogus: anotherint = "hello" -trait PointlessTrait -val (x,y) = (2,3) -println("hello") - -// ticket #1513 -val t1513 = Array(null) -// ambiguous toString problem from #547 -val atom = new scala.xml.Atom() -// overriding toString problem from #1404 -class S(override val toString : String) -val fish = new S("fish") -// Test that arrays pretty print nicely. -val arr = Array("What's", "up", "doc?") -// Test that arrays pretty print nicely, even when we give them type Any -val arrInt : Any = Array(1,2,3) -// Test that nested arrays are pretty-printed correctly -val arrArrInt : Any = Array(Array(1, 2), Array(3, 4)) - -// implicit conversions -case class Foo(n: Int) -case class Bar(n: Int) -implicit def foo2bar(foo: Foo) = Bar(foo.n) -val bar: Bar = Foo(3) - -// importing from a previous result -import bar._ -val m = n - -// stressing the imports mechanism -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 -val one = 1 - - -val x1 = 1 -val x2 = 1 -val x3 = 1 -val x4 = 1 -val x5 = 1 -val x6 = 1 -val x7 = 1 -val x8 = 1 -val x9 = 1 -val x10 = 1 -val x11 = 1 -val x12 = 1 -val x13 = 1 -val x14 = 1 -val x15 = 1 -val x16 = 1 -val x17 = 1 -val x18 = 1 -val x19 = 1 -val x20 = 1 - -val two = one + x5 - - -// interior syntax errors should *not* go into multi-line input mode. -// both of the following should abort immediately: -def x => y => z -[1,2,3] - - -// multi-line XML -<a> -<b - c="c" - d="dd" -/></a> - - -/* - /* - multi-line comment - */ -*/ - - -// multi-line string -""" -hello -there -""" - -(1 + // give up early by typing two blank lines - - -// defining and using quoted names should work (ticket #323) -def `match` = 1 -val x = `match` - -// multiple classes defined on one line -sealed class Exp; class Fact extends Exp; class Term extends Exp -def f(e: Exp) = e match {{ // non-exhaustive warning here - case _:Fact => 3 -}} - -.text - - /** A writer that skips the first line of text. The first - * line of interpreter output is skipped because it includes - * a version number. */ - class Skip1Writer(writer: Writer) extends Writer { - var seenNL = false - - def write(cbuf: Array[Char], off: Int, len: Int) { - if (seenNL) - writer.write(cbuf, off, len) - else { - val slice : Array[Char] = cbuf.slice(off, off+len) - val i = slice.indexOf('\n') - if (i >= 0) { - seenNL = true - writer.write(slice, i+1, slice.length-(i+1)) - } else { - // skip it - } - } - } - - def close() { writer.close() } - def flush() { writer.flush() } - } - - - def main(args: Array[String]) { - val input = new BufferedReader(new StringReader(testCodeString)) - val output = new PrintWriter( - new Skip1Writer(new OutputStreamWriter(Console.out))) - val repl = new InterpreterLoop(input, output) - repl.main(new Settings) - println() - - val interp = new Interpreter(new Settings) - interp.interpret("def plusOne(x: Int) = x + 1") - interp.interpret("plusOne(5)") - interp.reset() - interp.interpret("\"after reset\"") - interp.interpret("plusOne(5) // should be undefined now") - } -} diff --git a/test/files/jvm5/mkAnnotationsJar.sh b/test/files/jvm5/mkAnnotationsJar.sh deleted file mode 100755 index 0cd5e631a7..0000000000 --- a/test/files/jvm5/mkAnnotationsJar.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -############################################################################## -# Author : Nikolay Mihaylov -# Revision: $Id$ -############################################################################## - -############################################################################## -# variables - -OBJDIR=./classes - -if [ -z "${JAVA_HOME}" ]; then - echo "environment variable JAVA_HOME is undefined." - exit -fi - -JAVAC=${JAVA_HOME}/bin/javac -JAVAC_OPTIONS="-source 1.5 -target 1.5" - -JAR=${JAVA_HOME}/bin/jar - -############################################################################## -# commands - -mkdir -p ${OBJDIR} -${JAVAC} ${JAVAC_OPTIONS} -d ${OBJDIR} SourceAnnotation.java NestedAnnotations.java -${JAR} cf ../lib/annotations.jar -C ${OBJDIR} . -rm -rf ${OBJDIR} diff --git a/test/files/jvm5/outerEnum.check b/test/files/jvm5/outerEnum.check deleted file mode 100644 index ebd7525b33..0000000000 --- a/test/files/jvm5/outerEnum.check +++ /dev/null @@ -1 +0,0 @@ -Bar diff --git a/test/files/jvm5/outerEnum.scala b/test/files/jvm5/outerEnum.scala deleted file mode 100644 index 18794b7dbe..0000000000 --- a/test/files/jvm5/outerEnum.scala +++ /dev/null @@ -1,9 +0,0 @@ -import enums._ - -object Test extends Application { - def foo { - val res: OuterEnum.Foo = OuterEnum.Foo.Bar - println(res) - } - foo -} diff --git a/test/files/jvm5/stringbuilder.scala b/test/files/jvm5/stringbuilder.scala deleted file mode 100644 index cbbfa022b0..0000000000 --- a/test/files/jvm5/stringbuilder.scala +++ /dev/null @@ -1,100 +0,0 @@ -/* $Id$ */ - -import testing.SUnit._ - -/** Test the Scala implementation of class scala.StringBuilder. - * - * @author Stephane Micheloud - */ -object Test extends TestConsoleMain { - def suite = new TestSuite( - Test1, //ctor, reverse - Test2, //append - Test3, //insert - Test4 //indexOf, lastIndexOf - ) -} - -object Test1 extends TestCase("ctor") with Assert { - override def enableStackTrace = false - override def runTest { - val j0 = new java.lang.StringBuilder("abc") // Java 1.5+ - val s0 = new StringBuilder("abc") - assertEquals("s0 equals j0", false, s0 equals j0) - assertEquals("s0.toString equals j0.toString", true, s0.toString equals j0.toString) - - val str = """ -Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. It is also fully interoperable with Java.""" - val j1 = new java.lang.StringBuilder(100) append str - val s1 = new java.lang.StringBuilder(100) append str - assertEquals("s1.toString equals j1.toString", true, s1.toString equals j1.toString) - - val j2 = j0 reverse - val s2 = s0 reverse; - //println("j2="+j2+", s2="+s2)//debug - assertEquals("s2.toString equals j2.toString", true, s2.toString equals j2.toString) - - val j3 = j2; j3 setCharAt (0, j3 charAt 2) - val s3 = s2; s3(0) = s3(2) - //println("j3="+j3+", s3="+s3)//debug - assertEquals("s3.toString equals j3.toString", true, s3.toString equals j3.toString) - } -} - -object Test2 extends TestCase("append") with Assert { - override def enableStackTrace = false - override def runTest { - val j0 = new java.lang.StringBuilder("abc") // Java 1.5+ - val s0 = new StringBuilder("abc") - - j0 append true append (1.toByte) append 'a' append 9 append -1L append 1.2e-10f append -2.1e+100d - s0 append true append (1.toByte) append 'a' append 9 append -1L append 1.2e-10f append -2.1e+100d - - assertEquals("s0.toString equals j0.toString", true, s0.toString equals j0.toString) - - val j1 = new java.lang.StringBuilder // Java 1.5+ - val s1 = new StringBuilder - j1 append "###" append Array('0', '1', '2') append "xyz".subSequence(0, 3) - s1 append "###" append Array('0', '1', '2') append List('x', 'y', 'z') - assertEquals("s1.toString equals j1.toString", true, s1.toString equals j1.toString) - } -} - -object Test3 extends TestCase("insert") with Assert { - override def enableStackTrace = false - override def runTest { - val j0 = new java.lang.StringBuilder("abc") // Java 1.5+ - val s0 = new StringBuilder("abc") - - j0 insert (0, true) insert (0, 1.toByte) insert (0, 'a') insert (0, 88.toShort) insert (0, 9) insert (0, -1L) - s0 insert (0, true) insert (0, 1.toByte) insert (0, 'a') insert (0, 88.toShort) insert (0, 9) insert (0, -1L) - //println("j0="+j0+", s0="+s0)//debug - assertEquals("s0.toString equals j0.toString", true, s0.toString equals j0.toString) - - val j1 = new java.lang.StringBuilder // Java 1.5+ - val s1 = new StringBuilder - j1 insert (0, "###") insert (0, Array('0', '1', '2')) insert (0, "xyz".subSequence(0, 3)) - s1 insert (0, "###") insert (0, Array('0', '1', '2')) insert (0, List('x', 'y', 'z')) - //println("j1="+j1+", s1="+s1)//debug - assertEquals("s1.toString equals j1.toString", true, s1.toString equals j1.toString) - - } -} - -object Test4 extends TestCase("indefOf") with Assert { - override def enableStackTrace = false - override def runTest { - val j0 = new java.lang.StringBuilder("abc") // Java 1.5+ - val s0 = new StringBuilder("abc") - - val j1 = j0 indexOf("c") - val s1 = s0 indexOf("c") - //println("j1="+j1+", s1="+s1)//debug - assertEquals("s1 == j1", true, s1 == j1) - - val j2 = j0 append "123abc" lastIndexOf("c") - val s2 = s0 append "123abc" lastIndexOf("c") - //println("j2="+j2+", s2="+s2)//debug - assertEquals("s2 == j2", true, s2 == j2) - } -} diff --git a/test/files/jvm5/sync-var.check b/test/files/jvm5/sync-var.check deleted file mode 100644 index e77aa319a5..0000000000 --- a/test/files/jvm5/sync-var.check +++ /dev/null @@ -1 +0,0 @@ -50005000 50005000 true diff --git a/test/files/jvm5/sync-var.scala b/test/files/jvm5/sync-var.scala deleted file mode 100644 index aa6ae9fa34..0000000000 --- a/test/files/jvm5/sync-var.scala +++ /dev/null @@ -1,53 +0,0 @@ -import java.util.concurrent._ -import java.util.concurrent.atomic._ - -object Test { def main(args: Array[String]) { - -val n = 10000 -val i = new AtomicInteger(n) -val j = new AtomicInteger(n) -val sum = new AtomicInteger - -val q = new scala.concurrent.SyncVar[Int] - -val producers = (1 to 3).force map { z => new Thread { - override def run() { - var again = true - while (again) { - val x = i.getAndDecrement() - if (x > 0) - q put x - else - again = false - } - } -} } - -val summers = (1 to 7).force map { z => new Thread { - override def run() { - val x = j.decrementAndGet() - if (x >= 0) { - sum addAndGet q.take() - } - if (x > 0) { - run() - } else { - // done - } - } -} } - -summers foreach { _.start() } -producers foreach { _.start() } - -summers foreach { _.join() } - -val got = sum.get -val expected = (n + 1) * n / 2 -println(got + " " + expected + " " + (got == expected)) - -producers foreach { _.join() } - -} } - -// vim: set ts=2 sw=2 et: diff --git a/test/files/jvm5/t0014.check b/test/files/jvm5/t0014.check deleted file mode 100644 index bece7db7af..0000000000 --- a/test/files/jvm5/t0014.check +++ /dev/null @@ -1 +0,0 @@ -test.NestedAnnotations diff --git a/test/files/jvm5/t0014.scala b/test/files/jvm5/t0014.scala deleted file mode 100644 index a1948702dc..0000000000 --- a/test/files/jvm5/t0014.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - def main(args: Array[String]) { - println(classOf[test.NestedAnnotations].getName) - } -} diff --git a/test/files/jvm5/t1461.scala b/test/files/jvm5/t1461.scala deleted file mode 100644 index f0e3cea6cd..0000000000 --- a/test/files/jvm5/t1461.scala +++ /dev/null @@ -1,18 +0,0 @@ - -object Test { - def main(args: Array[String]) { - val jl = classOf[Foo].getMethod("jl", classOf[Baz[_]]) - jl.getGenericParameterTypes // works fine - - val l = classOf[Foo].getMethod("l", classOf[Baz[_]]) - // By debugger inspection l.signature is (Ltest/Baz;)V - l.getGenericParameterTypes // throws GenericSignatureFormatError - } -} - -class Baz[T] - -class Foo { - def l(b: Baz[Long]) { } - def jl(b: Baz[java.lang.Long]) { } -} diff --git a/test/files/jvm5/t1464.check b/test/files/jvm5/t1464.check deleted file mode 100644 index c508d5366f..0000000000 --- a/test/files/jvm5/t1464.check +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/files/jvm5/t1464/MyTrait.scala b/test/files/jvm5/t1464/MyTrait.scala deleted file mode 100644 index 0b8ccc412b..0000000000 --- a/test/files/jvm5/t1464/MyTrait.scala +++ /dev/null @@ -1,5 +0,0 @@ -trait MyTrait { - type K - def findChildByClass[T <: K with MyTrait]: Unit - -} diff --git a/test/files/jvm5/t1464/Test.java b/test/files/jvm5/t1464/Test.java deleted file mode 100644 index 235848b1df..0000000000 --- a/test/files/jvm5/t1464/Test.java +++ /dev/null @@ -1,6 +0,0 @@ -public class Test { - public static void main(String[] args) { - Object o = new Object(); - System.out.println(o instanceof MyTrait); - } -} diff --git a/test/files/jvm5/throws-annot.check b/test/files/jvm5/throws-annot.check deleted file mode 100644 index a0ed82b106..0000000000 --- a/test/files/jvm5/throws-annot.check +++ /dev/null @@ -1,21 +0,0 @@ -read throws: class java.io.IOException -read annotations: -readWith2 throws: class java.lang.ClassCastException, class java.io.IOException -readWith2 annotations: -readMixed throws: class java.io.IOException, class java.lang.NullPointerException -readMixed annotations: @java.lang.Deprecated() -readMixed2 throws: class java.io.IOException, class java.lang.NullPointerException -readMixed2 annotations: @java.lang.Deprecated() -readNoEx throws: -readNoEx annotations: @java.lang.Deprecated() -Testing mirror class -read throws: class java.io.IOException -read annotations: -readWith2 throws: class java.lang.ClassCastException, class java.io.IOException -readWith2 annotations: -readMixed throws: class java.io.IOException, class java.lang.NullPointerException -readMixed annotations: @java.lang.Deprecated() -readMixed2 throws: class java.io.IOException, class java.lang.NullPointerException -readMixed2 annotations: @java.lang.Deprecated() -readNoEx throws: -readNoEx annotations: @java.lang.Deprecated() diff --git a/test/files/jvm5/throws-annot.scala b/test/files/jvm5/throws-annot.scala deleted file mode 100644 index 90b58b9976..0000000000 --- a/test/files/jvm5/throws-annot.scala +++ /dev/null @@ -1,74 +0,0 @@ -/** Test the @throws annotation */ -import java.io.IOException - -object TestThrows { - - abstract class Foo { - - @throws(classOf[IOException]) - def read(): Int - - @throws(classOf[ClassCastException]) - @throws(classOf[IOException]) - def readWith2(): Int - - @throws(classOf[IOException]) - @Deprecated - @throws(classOf[NullPointerException]) - def readMixed(): Int - - @Deprecated - @throws(classOf[IOException]) - @throws(classOf[NullPointerException]) - def readMixed2(): Int - - @Deprecated - def readNoEx(): Int - } - - def checkMethod(cls: Class[_], name: String) { - val method = cls.getMethod(name) - println(name + " throws: " + method.getExceptionTypes.mkString("", ", ", "")) - println(name + " annotations: " + method.getDeclaredAnnotations.mkString("", ", ", "")) - } - - def run(cls: Class[_]) { - checkMethod(cls, "read") - checkMethod(cls, "readWith2") - checkMethod(cls, "readMixed") - checkMethod(cls, "readMixed2") - checkMethod(cls, "readNoEx") - } -} - -/** Test the top-level mirror that is has the annotations. */ -object TL { - - @throws(classOf[IOException]) - def read(): Int = 0 - - @throws(classOf[ClassCastException]) - @throws(classOf[IOException]) - def readWith2(): Int = 0 - - @throws(classOf[IOException]) - @Deprecated - @throws(classOf[NullPointerException]) - def readMixed(): Int = 0 - - @Deprecated - @throws(classOf[IOException]) - @throws(classOf[NullPointerException]) - def readMixed2(): Int = 0 - - @Deprecated - def readNoEx(): Int = 0 -} - -object Test { - def main(args: Array[String]) { - TestThrows.run(classOf[TestThrows.Foo]) - println("Testing mirror class") - TestThrows.run(Class.forName("TL")) - } -} diff --git a/test/files/jvm5/typerep.check b/test/files/jvm5/typerep.check deleted file mode 100755 index ca93180946..0000000000 --- a/test/files/jvm5/typerep.check +++ /dev/null @@ -1,49 +0,0 @@ -Boolean -Boolean -true -Byte -Char -Int -Long -Float -Double -String -Unit -Class[Int] - -Some[Int] -Some[Int] -Some[Some[Int]] -Some[List[Int]] -None -None - -List[Int] -List[Int] -List[List[Int]] -Nil -List[Any] - -Array[Int] -Array[Array[Int]] -Array[Int] -Array[Int] -Array[Int] -Array[Int] - -Tuple2[Int, String] -Tuple3[Char, Char, String] -Tuple2[Tuple2[Int, String], Tuple2[Int, String]] -Tuple2[Tuple2[Some[Char], Int], Tuple2[Some[Char], Int]] - -Function1[Int, Int] -Int -Function1[Int, Int] -Int -Function1[Int, Function1[Int, Int]] -Function1[Int, Int] -Int -Function3[Boolean, List[Char], Int, Int] -Function2[Function1[Int, Int], Int, Int] -Int - diff --git a/test/files/jvm5/typerep.scala b/test/files/jvm5/typerep.scala deleted file mode 100755 index fc94817adf..0000000000 --- a/test/files/jvm5/typerep.scala +++ /dev/null @@ -1,383 +0,0 @@ -//############################################################################ -// Type Representation at runtime -//############################################################################ -// $Id: $ - -import TypeRep._ - -object Test extends Application { - testPrimitives - testOptions - testLists - testArrays - testTuples - testFuncs - testClasses -} - -object serialize { - import java.io._ - - @throws(classOf[IOException]) - def write[A](o: A): Array[Byte] = { - val ba = new ByteArrayOutputStream(512) - val out = new ObjectOutputStream(ba) - out.writeObject(o) - out.close() - ba.toByteArray() - } - @throws(classOf[IOException]) - @throws(classOf[ClassNotFoundException]) - def read[A](buffer: Array[Byte]): A = { - val in = - new ObjectInputStream(new ByteArrayInputStream(buffer)) - in.readObject().asInstanceOf[A] - } -} - -object testPrimitives { - println(getType(true)) - val b = false; val bt = getType(b) - println(bt) - val bt1: TypeRep[Boolean] = serialize.read(serialize.write(bt)) - println(bt1 == bt) - println(getType(16.toByte)) - println(getType('a')) - println(getType(3)) - println(getType(3l)) - println(getType(0.0f)) - println(getType(0.0d)) - println(getType("abc")) - println(getType(())) // Unit - println(getType(classOf[Int])) // Class - println -} - -object testOptions { - println(getType(Some(2))) - val x: Option[Int] = Some(2) - println(getType(x)) - println(getType(Some(Some(3)))) - println(getType(Some(List(3)))) - //println(getType(Some(None: List[Int]))) // error: no implicit argument matching parameter type TypeRep[object None] was foun - println(getType(None: Option[Int])) - val y: Option[Int] = None - println(getType(y)) - println -} - -object testLists { - println(getType(List(3))) - println(getType(3 :: Nil)) - println(getType(List(List(3)))) - println(getType(Nil: List[Int])) - println(getType(List(1, "abc"))) - println -} - -object testArrays { - println(getType(Array(3))) - println(getType(Array(Array(3), Array(4)))) - println(getType(new Array[Int](0))) - println(getType(List(1).toArray)) - println(getType(List[Int]().toArray)) - println(getType(Array(3).drop(1).toArray)) // empty - println -} - -object testTuples { - println(getType((3, "abc"))) - println(getType(Triple('a', 'b', "c"))) - println(getType(((3, "abc"), (4, "xyz")))) - println(getType(((Some('b'), 3), (Some('a'), 4)))) - //println(getType(((Some('b'), 3), (None, 4)))) - println -} - -object testFuncs { - def f1(x: Int): Int = 2 * x - println(getType(f1 _)) - println(getType(f1(2))) - val f2 = (x: Int) => 2 * x - println(getType(f2)) - println(getType(f2(2))) - val f3 = (x: Int) => (y: Int) => x + y - println(getType(f3)) - println(getType(f3(2))) - println(getType(f3(2)(2))) - def f4(b: Boolean, c: List[Char], i: Int): Int = i - println(getType(f4 _)) - def f5(f: Int => Int, x: Int) = f(x) - println(getType(f5 _)) - println(getType(f5(f1, 1))) - println -} - -class Foo { - class Bar(x: Int) -} - - -object foo extends Foo - -package pkg1 { - class C1 - object c1 extends C1 -} - -object testClasses { - /* - case object FooRep extends TypeRep[Foo] { - override def toString = "Foo" - } - implicit def fooRep[A](x: A)(implicit rep: TypeRep[foo.type]): TypeRep[foo.type] = rep - println(getType(foo)) - println(getType(new foo.Bar(0))) - val foo2 = new Foo - println(getType(foo2)) - println(getType(new foo2.Bar(1))) - println - - println(getType(pkg1.c1)) - val c1 = new pkg1.C1 - println(getType(c1)) - println - */ -} - - -/** - * @author Stephane Micheloud - * @version 1.0 - */ -abstract class TypeRep[A] - -object TypeRep { - - def getType[A](x: A)(implicit rep: TypeRep[A]): TypeRep[A] = rep - - def getType[A](x: Option[A])(implicit rep: TypeRep[A]): TypeRep[Option[A]] = (x match { - case Some(v) => SomeRep(rep) - case None => NoneRep - }).asInstanceOf[TypeRep[Option[A]]] - - def getType[A](x: List[A])(implicit rep: TypeRep[A]): TypeRep[List[A]] = (x match { - case h :: t => ListRep(getType(h)) - case Nil => NilRep - }).asInstanceOf[TypeRep[List[A]]] - - implicit def boolRep: TypeRep[Boolean] = BooleanRep - implicit def byteRep: TypeRep[Byte] = ByteRep - implicit def charRep: TypeRep[Char] = CharRep - implicit def shortRep: TypeRep[Short] = ShortRep - implicit def intRep: TypeRep[Int] = IntRep - implicit def longRep: TypeRep[Long] = LongRep - implicit def floatRep: TypeRep[Float] = FloatRep - implicit def doubleRep: TypeRep[Double] = DoubleRep - - implicit def unitRep: TypeRep[Unit] = UnitRep - implicit def stringRep: TypeRep[String] = StringRep - //implicit def noneRep: TypeRep[None.type] = NoneRep//[Nothing](NothingRep.asInstanceOf[TypeRep[Nothing]]) - implicit def anyRep: TypeRep[Any] = AnyRep - implicit def nothingRep: TypeRep[Nothing] = NothingRep - - implicit def classRep[A](implicit elemrep: TypeRep[A]): TypeRep[Class[A]] = - ClassRep(elemrep) - - implicit def someRep[A](implicit elemrep: TypeRep[A]): TypeRep[Some[A]] = - SomeRep(elemrep) - - implicit def listRep[A](implicit elemrep: TypeRep[A]): TypeRep[List[A]] = - ListRep(elemrep) - - implicit def arrayRep[A](implicit elemrep: TypeRep[A]): TypeRep[Array[A]] = - ArrayRep(elemrep) - - implicit def tuple2Rep[A1, A2](implicit _1: TypeRep[A1], _2: TypeRep[A2]): TypeRep[(A1, A2)] = - Tuple2Rep(_1, _2) - - implicit def tuple3Rep[A1, A2, A3](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3]): TypeRep[(A1, A2, A3)] = - Tuple3Rep(_1, _2, _3) - implicit def tuple4Rep[A1, A2, A3, A4](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4]): TypeRep[Tuple4[A1, A2, A3, A4]] = - Tuple4Rep(_1, _2, _3, _4) - implicit def tuple5Rep[A1, A2, A3, A4, A5](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4], _5: TypeRep[A5]): TypeRep[Tuple5[A1, A2, A3, A4, A5]] = - Tuple5Rep(_1, _2, _3, _4, _5) - implicit def tuple6Rep[A1, A2, A3, A4, A5, A6](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4], _5: TypeRep[A5], _6: TypeRep[A6]): TypeRep[Tuple6[A1, A2, A3, A4, A5, A6]] = - Tuple6Rep(_1, _2, _3, _4, _5, _6) - implicit def tuple7Rep[A1, A2, A3, A4, A5, A6, A7](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4], _5: TypeRep[A5], _6: TypeRep[A6], _7: TypeRep[A7]): TypeRep[Tuple7[A1, A2, A3, A4, A5, A6, A7]] = - Tuple7Rep(_1, _2, _3, _4, _5, _6, _7) - implicit def tuple8Rep[A1, A2, A3, A4, A5, A6, A7, A8](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4], _5: TypeRep[A5], _6: TypeRep[A6], _7: TypeRep[A7], _8: TypeRep[A8]): TypeRep[Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]] = - Tuple8Rep(_1, _2, _3, _4, _5, _6, _7, _8) - implicit def tuple9Rep[A1, A2, A3, A4, A5, A6, A7, A8, A9](implicit _1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4], _5: TypeRep[A5], _6: TypeRep[A6], _7: TypeRep[A7], _8: TypeRep[A8], _9: TypeRep[A9]): TypeRep[Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]] = - Tuple9Rep(_1, _2, _3, _4, _5, _6, _7, _8, _9) - - implicit def func1Rep[A1, B](implicit a1: TypeRep[A1], b: TypeRep[B]): TypeRep[Function1[A1, B]] = - Function1Rep(a1, b) - implicit def func2Rep[A1, A2, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], b: TypeRep[B]): TypeRep[Function2[A1, A2, B]] = - Function2Rep(a1, a2, b) - implicit def func3Rep[A1, A2, A3, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], b: TypeRep[B]): TypeRep[Function3[A1, A2, A3, B]] = - Function3Rep(a1, a2, a3, b) - implicit def func4Rep[A1, A2, A3, A4, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], b: TypeRep[B]): TypeRep[Function4[A1, A2, A3, A4, B]] = - Function4Rep(a1, a2, a3, a4, b) - implicit def func5Rep[A1, A2, A3, A4, A5, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], b: TypeRep[B]): TypeRep[Function5[A1, A2, A3, A4, A5, B]] = - Function5Rep(a1, a2, a3, a4, a5, b) - implicit def func6Rep[A1, A2, A3, A4, A5, A6, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], b: TypeRep[B]): TypeRep[Function6[A1, A2, A3, A4, A5, A6, B]] = - Function6Rep(a1, a2, a3, a4, a5, a6, b) - implicit def func7Rep[A1, A2, A3, A4, A5, A6, A7, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], a7: TypeRep[A7], b: TypeRep[B]): TypeRep[Function7[A1, A2, A3, A4, A5, A6, A7, B]] = - Function7Rep(a1, a2, a3, a4, a5, a6, a7, b) - implicit def func8Rep[A1, A2, A3, A4, A5, A6, A7, A8, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], a7: TypeRep[A7], a8: TypeRep[A8], b: TypeRep[B]): TypeRep[Function8[A1, A2, A3, A4, A5, A6, A7, A8, B]] = - Function8Rep(a1, a2, a3, a4, a5, a6, a7, a8, b) - implicit def func9Rep[A1, A2, A3, A4, A5, A6, A7, A8, A9, B](implicit a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], a7: TypeRep[A7], a8: TypeRep[A8], a9: TypeRep[A9], b: TypeRep[B]): TypeRep[Function9[A1, A2, A3, A4, A5, A6, A7, A8, A9, B]] = - Function9Rep(a1, a2, a3, a4, a5, a6, a7, a8, a9, b) -/* - implicit def objectRep[A <: AnyRef](obj: A)(implicit rep: TypeRep[A]): TypeRep[AnyClass] = - ObjectRep(obj.getClass) -*/ - - case object BooleanRep extends TypeRep[Boolean] { - override def toString = "Boolean" - } - case object ByteRep extends TypeRep[Byte] { - override def toString = "Byte" - } - case object CharRep extends TypeRep[Char] { - override def toString = "Char" - } - case object ShortRep extends TypeRep[Short] { - override def toString = "Short" - } - case object IntRep extends TypeRep[Int] { - override def toString = "Int" - } - case object LongRep extends TypeRep[Long] { - override def toString = "Long" - } - case object FloatRep extends TypeRep[Float] { - override def toString = "Float" - } - case object DoubleRep extends TypeRep[Double] { - override def toString = "Double" - } - - case object UnitRep extends TypeRep[Unit] { - override def toString = "Unit" - } -// case object ClassRep extends TypeRep[AnyClass] { -// override def toString = "Class" -// } - case object StringRep extends TypeRep[String] { - override def toString = "String" - } - case object NoneRep extends TypeRep[None.type] { - override def toString = "None" - } - case object NilRep extends TypeRep[Nil.type] { - override def toString = "Nil" - } - case object AnyRep extends TypeRep[Any] { - override def toString = "Any" - } - case object NothingRep extends TypeRep[Nothing] { - override def toString = "Nothing" - } - - @serializable - case class ClassRep[A](elemRep: TypeRep[A]) extends TypeRep[Class[A]] { - override def toString = "Class[" + elemRep + "]" - } - @serializable - case class SomeRep[A](elemRep: TypeRep[A]) extends TypeRep[Some[A]] { - override def toString = "Some[" + elemRep + "]" - } - @serializable - case class NoneRep[A](elemRep: TypeRep[A]) extends TypeRep[Option[A]] { - override def toString = "None[" + elemRep + "]" - } - - @serializable - case class ListRep[A](elemRep: TypeRep[A]) extends TypeRep[List[A]] { - override def toString = "List[" + elemRep + "]" - } - - @serializable - case class ArrayRep[A](elemRep: TypeRep[A]) extends TypeRep[Array[A]] { - override def toString = "Array[" + elemRep + "]" - } - - @serializable - case class Tuple2Rep[A1, A2](_1: TypeRep[A1], _2: TypeRep[A2]) extends TypeRep[(A1, A2)] { - override def toString = "Tuple2[" + _1 + ", " + _2 + "]" - } - @serializable - case class Tuple3Rep[A1, A2, A3](_1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3]) extends TypeRep[Tuple3[A1, A2, A3]] { - override def toString = "Tuple3[" + _1 + ", " + _2 + ", " + _3 + "]" - } - @serializable - case class Tuple4Rep[A1, A2, A3, A4](_1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4]) extends TypeRep[Tuple4[A1, A2, A3, A4]] { - override def toString = "Tuple4[" + _1 + ", " + _2 + ", " + _3 + ", " + _4 + "]" - } - @serializable - case class Tuple5Rep[A1, A2, A3, A4, A5](_1: TypeRep[A1], _2: TypeRep[A2], _3: TypeRep[A3], _4: TypeRep[A4], _5: TypeRep[A5]) extends TypeRep[Tuple5[A1, A2, A3, A4, A5]] { - override def toString = "Tuple5[" + _1 + ", " + _2 + ", " + _3 + ", " + _4 + ", " + _5 + "]" - } - @serializable - case class Tuple6Rep[A1, A2, A3, A4, A5, A6](val _1: TypeRep[A1], val _2: TypeRep[A2], val _3: TypeRep[A3], val _4: TypeRep[A4], val _5: TypeRep[A5], val _6: TypeRep[A6]) extends TypeRep[Tuple6[A1, A2, A3, A4, A5, A6]] { - override def toString = "Tuple6[" + _1 + ", " + _2 + ", " + _3 + ", " + _4 + ", " + _5 + ", " + _6 + "]" - } - @serializable - case class Tuple7Rep[A1, A2, A3, A4, A5, A6, A7](val _1: TypeRep[A1], val _2: TypeRep[A2], val _3: TypeRep[A3], val _4: TypeRep[A4], val _5: TypeRep[A5], val _6: TypeRep[A6], val _7: TypeRep[A7]) extends TypeRep[Tuple7[A1, A2, A3, A4, A5, A6, A7]] { - override def toString = "Tuple7[" + _1 + ", " + _2 + ", " + _3 + ", " + _4 + ", " + _5 + ", " + _6 + ", " + _7 + "]" - } - @serializable - case class Tuple8Rep[A1, A2, A3, A4, A5, A6, A7, A8](val _1: TypeRep[A1], val _2: TypeRep[A2], val _3: TypeRep[A3], val _4: TypeRep[A4], val _5: TypeRep[A5], val _6: TypeRep[A6], val _7: TypeRep[A7], val _8: TypeRep[A8]) extends TypeRep[Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]] { - override def toString = "Tuple8[" + _1 + ", " + _2 + ", " + _3 + ", " + _4 + ", " + _5 + ", " + _6 + ", " + _7 + ", " + _8 + "]" - } - @serializable - case class Tuple9Rep[A1, A2, A3, A4, A5, A6, A7, A8, A9](val _1: TypeRep[A1], val _2: TypeRep[A2], val _3: TypeRep[A3], val _4: TypeRep[A4], val _5: TypeRep[A5], val _6: TypeRep[A6], val _7: TypeRep[A7], val _8: TypeRep[A8], val _9: TypeRep[A9]) extends TypeRep[Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]] { - override def toString = "Tuple9[" + _1 + ", " + _2 + ", " + _3 + ", " + _4 + ", " + _5 + ", " + _6 + ", " + _7 + ", " + _8 + ", " + _9 + "]" - } - - @serializable - case class Function1Rep[A1, B](a1: TypeRep[A1], b: TypeRep[B]) extends TypeRep[Function1[A1, B]] { - override def toString = "Function1[" + a1 + ", " + b + "]" - } - @serializable - case class Function2Rep[A1, A2, B](a1: TypeRep[A1], a2: TypeRep[A2], b: TypeRep[B]) extends TypeRep[Function2[A1, A2, B]] { - override def toString = "Function2[" + a1 + ", " + a2 + ", " + b + "]" - } - @serializable - case class Function3Rep[A1, A2, A3, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], b: TypeRep[B]) extends TypeRep[Function3[A1, A2, A3, B]] { - override def toString = "Function3[" + a1 + ", " + a2 + ", " + a3 + ", " + b + "]" - } - @serializable - case class Function4Rep[A1, A2, A3, A4, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], b: TypeRep[B]) extends TypeRep[Function4[A1, A2, A3, A4, B]] { - override def toString = "Function4[" + a1 + ", " + a2 + ", " + a3 + ", " + a4 + ", " + b + "]" - } - @serializable - case class Function5Rep[A1, A2, A3, A4, A5, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], b: TypeRep[B]) extends TypeRep[Function5[A1, A2, A3, A4, A5, B]] { - override def toString = "Function5[" + a1 + ", " + a2 + ", " + a3 + ", " + a4 + ", " + a5 + ", " + b + "]" - } - @serializable - case class Function6Rep[A1, A2, A3, A4, A5, A6, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], b: TypeRep[B]) extends TypeRep[Function6[A1, A2, A3, A4, A5, A6, B]] { - override def toString = "Function6[" + a1 + ", " + a2 + ", " + a3 + ", " + a4 + ", " + a5 + ", " + a6 + ", " + b + "]" - } - @serializable - case class Function7Rep[A1, A2, A3, A4, A5, A6, A7, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], a7: TypeRep[A7], b: TypeRep[B]) extends TypeRep[Function7[A1, A2, A3, A4, A5, A6, A7, B]] { - override def toString = "Function7[" + a1 + ", " + a2 + ", " + a3 + ", " + a4 + ", " + a5 + ", " + a6 + ", " + a7 + ", " + b + "]" - } - @serializable - case class Function8Rep[A1, A2, A3, A4, A5, A6, A7, A8, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], a7: TypeRep[A7], a8: TypeRep[A8], b: TypeRep[B]) extends TypeRep[Function8[A1, A2, A3, A4, A5, A6, A7, A8, B]] { - override def toString = "Function8[" + a1 + ", " + a2 + ", " + a3 + ", " + a4 + ", " + a5 + ", " + a6 + ", " + a7 + ", " + a8 + b + "]" - } - @serializable - case class Function9Rep[A1, A2, A3, A4, A5, A6, A7, A8, A9, B](a1: TypeRep[A1], a2: TypeRep[A2], a3: TypeRep[A3], a4: TypeRep[A4], a5: TypeRep[A5], a6: TypeRep[A6], a7: TypeRep[A7], a8: TypeRep[A8], a9: TypeRep[A9], b: TypeRep[B]) extends TypeRep[Function9[A1, A2, A3, A4, A5, A6, A7, A8, A9, B]] { - override def toString = "Function9[" + a1 + ", " + a2 + ", " + a3 + ", " + a4 + ", " + a5 + ", " + a6 + ", " + a7 + ", " + a8 + ", " + b + "]" - } -/* - @serializable - case class ObjectRep[A](c: Class) extends TypeRep[A] { - override def toString = c.getName - } -*/ -} - -- cgit v1.2.3