summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-09-12 10:18:33 +0000
committerMartin Odersky <odersky@gmail.com>2006-09-12 10:18:33 +0000
commitdc97215ec989aa4739c18aa74fa8f2ead78402f4 (patch)
tree3239a9bc794542f9a9770a95c884e1e8b65b68aa /test/files
parent7165e8d40d3abede0e83acb1bd8419708b44ded6 (diff)
downloadscala-dc97215ec989aa4739c18aa74fa8f2ead78402f4.tar.gz
scala-dc97215ec989aa4739c18aa74fa8f2ead78402f4.tar.bz2
scala-dc97215ec989aa4739c18aa74fa8f2ead78402f4.zip
fixes to ExplicitOuter to pass test suite
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/bug704.scala27
-rw-r--r--test/files/run/implicits.check2
-rwxr-xr-xtest/files/run/implicits.scala25
3 files changed, 45 insertions, 9 deletions
diff --git a/test/files/pos/bug704.scala b/test/files/pos/bug704.scala
index aea8292f2d..a05e0a51e7 100644
--- a/test/files/pos/bug704.scala
+++ b/test/files/pos/bug704.scala
@@ -1,14 +1,23 @@
trait D {
- private val x = 1
+ private val x = "xxxx should appear twice"
private object xxxx { Console.println(x) }
+ def get_xxxx: AnyRef = xxxx
}
-object Go extends D {
- def main(args : Array[String]) : Unit = {};
-}
-trait D2 {
- val x = 1
- object yyyy { Console.println(x) }
+
+trait E extends D {
+ def f(): unit = {
+ val y = "yyyy should appear twice"
+ object yyyy {
+ val x1 = get_xxxx
+ Console.println(y)
+ }
+ yyyy
+ }
}
-object Go2 extends D2 {
- def main(args : Array[String]) : Unit = {};
+class C extends E {}
+object Go extends D {
+ def main(args : Array[String]) {
+ new C().f()
+ new C().f()
+ }
}
diff --git a/test/files/run/implicits.check b/test/files/run/implicits.check
new file mode 100644
index 0000000000..010571589c
--- /dev/null
+++ b/test/files/run/implicits.check
@@ -0,0 +1,2 @@
+OK
+[2]
diff --git a/test/files/run/implicits.scala b/test/files/run/implicits.scala
new file mode 100755
index 0000000000..c45badc49f
--- /dev/null
+++ b/test/files/run/implicits.scala
@@ -0,0 +1,25 @@
+object A {
+ object B {
+ implicit def int2string(x: int) = "["+x.toString+"]"
+ }
+}
+
+class C(x: String) {
+
+ class Inner {
+ }
+
+ object Inner {
+ val s: String = x
+ implicit def Inner2String(x: Inner): String = s
+ }
+}
+
+object Test extends Application {
+ import A.B._
+ val c = new C("OK")
+ val i = new c.Inner
+ val s: String = i
+ Console.println(s)
+ Console.println(2: String)
+}