aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/anonClassSubtyping.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2014-12-28 17:42:04 +0100
committerGuillaume Martres <smarter@ubuntu.com>2015-02-11 16:33:20 +0100
commit5150cad821a9e7db821732eeb19019b96e1975a0 (patch)
treed69db0675c5b79952ec8e44f7dff48fc24316e34 /tests/pos/anonClassSubtyping.scala
parent03a2c6e74c07d08e79ee3323d3c1c38eb3d588ef (diff)
downloaddotty-5150cad821a9e7db821732eeb19019b96e1975a0.tar.gz
dotty-5150cad821a9e7db821732eeb19019b96e1975a0.tar.bz2
dotty-5150cad821a9e7db821732eeb19019b96e1975a0.zip
Prevent block types with references to local symbols
Diffstat (limited to 'tests/pos/anonClassSubtyping.scala')
-rw-r--r--tests/pos/anonClassSubtyping.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/pos/anonClassSubtyping.scala b/tests/pos/anonClassSubtyping.scala
new file mode 100644
index 000000000..b5591d826
--- /dev/null
+++ b/tests/pos/anonClassSubtyping.scala
@@ -0,0 +1,9 @@
+object O {
+ class A
+ class B
+ def f[T](x: T, y: T): T = x
+
+ val x: A = f(new A { }, new A)
+
+ val y: A | B = f(new A { }, new B)
+}