From 969384da702f2168bfe75d83870fe1b11b12c0c4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 13 Nov 2007 13:14:15 +0000 Subject: fixed #234; added tests --- test/files/neg/t0204.check | 4 ++++ test/files/neg/t0204.scala | 5 +++++ test/files/neg/t0207.check | 7 +++++++ test/files/neg/t0207.scala | 4 ++++ test/files/pos/t0165.scala | 14 ++++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 test/files/neg/t0204.check create mode 100755 test/files/neg/t0204.scala create mode 100644 test/files/neg/t0207.check create mode 100755 test/files/neg/t0207.scala create mode 100755 test/files/pos/t0165.scala (limited to 'test/files') diff --git a/test/files/neg/t0204.check b/test/files/neg/t0204.check new file mode 100644 index 0000000000..5af6d146d5 --- /dev/null +++ b/test/files/neg/t0204.check @@ -0,0 +1,4 @@ +t0204.scala:4: error: class type required + trait C extends B + ^ +one error found diff --git a/test/files/neg/t0204.scala b/test/files/neg/t0204.scala new file mode 100755 index 0000000000..0de9d9d16d --- /dev/null +++ b/test/files/neg/t0204.scala @@ -0,0 +1,5 @@ +object Program { + trait A { type T } + type B = A { type T = String } + trait C extends B +} diff --git a/test/files/neg/t0207.check b/test/files/neg/t0207.check new file mode 100644 index 0000000000..b1d8d42ffb --- /dev/null +++ b/test/files/neg/t0207.check @@ -0,0 +1,7 @@ +t0207.scala:3: error: type T takes type parameters + type S = (T with T)[A] + ^ +t0207.scala:3: error: type T takes type parameters + type S = (T with T)[A] + ^ +two errors found diff --git a/test/files/neg/t0207.scala b/test/files/neg/t0207.scala new file mode 100755 index 0000000000..d9df0ca951 --- /dev/null +++ b/test/files/neg/t0207.scala @@ -0,0 +1,4 @@ +trait A { + type T[_] + type S = (T with T)[A] +} diff --git a/test/files/pos/t0165.scala b/test/files/pos/t0165.scala new file mode 100755 index 0000000000..05c4a1c77a --- /dev/null +++ b/test/files/pos/t0165.scala @@ -0,0 +1,14 @@ +package test3 +import scala.collection.jcl.LinkedHashMap + +trait Main { + def asMany : ArrayResult = { + object result extends LinkedHashMap[String,String] with ArrayResult { + def current = result + } + result + } + trait ArrayResult { + def current : scala.collection.Map[String,String] + } +} -- cgit v1.2.3