summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-03-17 18:56:09 +0000
committerMartin Odersky <odersky@gmail.com>2008-03-17 18:56:09 +0000
commit86ddfebfbd0ea938d01442b3fc7d65c5d5324be9 (patch)
treec70f0332ee2400b269e3bfaed795153d5a917c86 /src/compiler
parent647c6d8d3cc5673b4d5c7656587842ed99521d34 (diff)
downloadscala-86ddfebfbd0ea938d01442b3fc7d65c5d5324be9.tar.gz
scala-86ddfebfbd0ea938d01442b3fc7d65c5d5324be9.tar.bz2
scala-86ddfebfbd0ea938d01442b3fc7d65c5d5324be9.zip
added CharSequence abstraction
changed Regex class added Regex parsers changed thrown Errors in library to RuntimeExceptions added lazy_::, lazy_::: constructors and extractors for streams changed maximally supported function type arity to 22
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Definitions.scala2
-rwxr-xr-xsrc/compiler/scala/tools/nsc/typechecker/DeVirtualize.txt56
2 files changed, 57 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
index e76be5a09d..aa5131a445 100644
--- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
@@ -229,7 +229,7 @@ trait Definitions {
}).normalize
/* </unapply> */
- val MaxFunctionArity = 9
+ val MaxFunctionArity = 22
val FunctionClass: Array[Symbol] = new Array(MaxFunctionArity + 1)
def functionApply(n: Int) = getMember(FunctionClass(n), nme.apply)
def functionType(formals: List[Type], restpe: Type) =
diff --git a/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.txt b/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.txt
new file mode 100755
index 0000000000..4ca1317d5e
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/typechecker/DeVirtualize.txt
@@ -0,0 +1,56 @@
+ /*
+ class A {
+ class C[X, Y](x: X) <: { var y = x ; def f(z: Y): X }
+ class D[Y](z) extends C[Int, Y](f(z)) { override def f(z:Int) = 3 }
+ }
+ class B extends A {
+ class C[X, Y](x: X) <: { def g = 2 }
+ }
+ */
+
+ class A {
+ type C[X, Y] <: CT[X, Y]
+
+ trait CT { self: C => protected[this] val x: Int; val y = x; def f(z:Int) = z + 1 }
+
+ type D <: C with DT
+
+ trait DT extends { self: D => def f(z:Int) = z + 2 }
+
+ trait preDT extends { self: D => val z: Int; val x = f(z) }
+
+ def newC(x: Int): C
+ def newD(x: Int): D
+
+ //type C = CT
+ //type D = C with DT
+
+ class CC(_x:Int) extends { val x = _x } with CT
+
+ def newC(x:Int): C = new CC(x).asInstanceOf[C]
+
+ class DC(_z:Int) extends { val z = _z } with preDT with CT with DT {
+ override def f(z:Int) = super.f(z)
+ }
+
+ def newD(z:Int):D = new DC(z).asInstanceOf[D]
+ }
+
+ class B extends A {
+ type C <: CT with CT2
+
+ trait CT2 { self : C => def g = 2 }
+
+ //type C = CT with CT2
+ //type D = C with DT
+
+ class CC2(_x:Int) extends { val x = _x } with CT with CT2
+
+ def newC(x:Int): C = new CC2(x).asInstanceOf[C]
+
+ class DC2(_z:Int) extends { val z = _z } with preDT with CT with CT2
+ with DT { override def f(z:Int) = super.f(z) }
+
+ def newD(z:Int): D = new DC2(z).asInstanceOf[D]
+ }
+