diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2005-11-25 12:49:14 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2005-11-25 12:49:14 +0000 |
commit | a92ce124f53e07351387b34898e1adf3e75c952b (patch) | |
tree | 539ee2624d7209f0d6f18eec0c4bb20e435848e0 | |
parent | ad017dcfba6211835087cbf47e2d2f202a8d2f6f (diff) | |
download | scala-a92ce124f53e07351387b34898e1adf3e75c952b.tar.gz scala-a92ce124f53e07351387b34898e1adf3e75c952b.tar.bz2 scala-a92ce124f53e07351387b34898e1adf3e75c952b.zip |
*** empty log message ***
-rw-r--r-- | test-nsc/files/run/bugs.check | 1 | ||||
-rw-r--r-- | test-nsc/files/run/ctor-order.check | 1 | ||||
-rw-r--r-- | test-nsc/files/run/ctor-order.scala | 26 |
3 files changed, 28 insertions, 0 deletions
diff --git a/test-nsc/files/run/bugs.check b/test-nsc/files/run/bugs.check index 7ad8f3db8d..1cf55421f8 100644 --- a/test-nsc/files/run/bugs.check +++ b/test-nsc/files/run/bugs.check @@ -45,6 +45,7 @@ ok >>> bug 199 <<< bug 213 +Exception in thread "Thread[main,5,main]" java.lang.ClassCastException >>> bug 213 <<< bug 217 diff --git a/test-nsc/files/run/ctor-order.check b/test-nsc/files/run/ctor-order.check new file mode 100644 index 0000000000..f599e28b8a --- /dev/null +++ b/test-nsc/files/run/ctor-order.check @@ -0,0 +1 @@ +10 diff --git a/test-nsc/files/run/ctor-order.scala b/test-nsc/files/run/ctor-order.scala new file mode 100644 index 0000000000..b21ae27658 --- /dev/null +++ b/test-nsc/files/run/ctor-order.scala @@ -0,0 +1,26 @@ + +/** Test that constructor operations are reordered correctly. */ +class Outer { + + object global { + val x = 10; + } + + class X extends AnyRef with M1 { + /* The constructor of X should set this.$outer to the outer instance + * *before* calling the super constructors. This is tested by + * mixin M1, which tries to access global from the enclosing class. + */ + } + + trait M1: X { + Console.println(global.x); + } + +} + +object Test extends AnyRef with Application { + val o = new Outer; + + new o.X; +} |