aboutsummaryrefslogtreecommitdiff
path: root/tests/run
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-20 00:43:28 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-20 00:43:37 +0200
commitc093792189f49c3e72ada99ca0fdb97e4023ef78 (patch)
treeaffb7d3f9df4651c1bf52cbe6ec928340026decc /tests/run
parent9bf44f867c1a9f4625dd7fac9575c3e74373402b (diff)
downloaddotty-c093792189f49c3e72ada99ca0fdb97e4023ef78.tar.gz
dotty-c093792189f49c3e72ada99ca0fdb97e4023ef78.tar.bz2
dotty-c093792189f49c3e72ada99ca0fdb97e4023ef78.zip
Map proxy references in constructors to parameters
Proxy references in constructors can't be left as fields because they can happen before the supercall.
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/shortClass.check10
-rw-r--r--tests/run/shortClass.scala24
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/run/shortClass.check b/tests/run/shortClass.check
new file mode 100644
index 000000000..fbdb725cc
--- /dev/null
+++ b/tests/run/shortClass.check
@@ -0,0 +1,10 @@
+bippity.bop.Foo
+bippity.bop.Foo$Bar
+bippity.bop.Foo$Bar$
+Test$$anon$1
+Test$$anon$2
+Foo
+Bar
+Bar$
+Foo with DingDongBippy
+Bar with DingDongBippy
diff --git a/tests/run/shortClass.scala b/tests/run/shortClass.scala
new file mode 100644
index 000000000..b7bb01689
--- /dev/null
+++ b/tests/run/shortClass.scala
@@ -0,0 +1,24 @@
+import scala.reflect.internal.util._
+
+package bippity {
+ trait DingDongBippy
+
+ package bop {
+ class Foo {
+ class Bar
+ object Bar
+ }
+ }
+}
+
+object Test {
+ import bippity._
+ import bop._
+
+ def main(args: Array[String]): Unit = {
+ val f = new Foo
+ val instances = List(f, new f.Bar, f.Bar, new Foo with DingDongBippy, new f.Bar with DingDongBippy)
+ instances map (_.getClass.getName) foreach println
+ instances map shortClassOfInstance foreach println
+ }
+}