summaryrefslogtreecommitdiff
path: root/test/files/pos/t5317.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/t5317.scala')
-rw-r--r--test/files/pos/t5317.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/pos/t5317.scala b/test/files/pos/t5317.scala
new file mode 100644
index 0000000000..8c9c9d8222
--- /dev/null
+++ b/test/files/pos/t5317.scala
@@ -0,0 +1,12 @@
+object Test {
+ trait S { type T; val x: AnyRef }
+ trait A extends S { type T <: A; val x: A = null }
+ trait B extends S { type T <: B; val x: B = null }
+
+ val a = new A{}
+ val b = new B{}
+ val y = if (true) a else b
+
+ // lub of y should allow for this
+ println(y.x.x)
+}