aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/t6815.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/t6815.scala')
-rw-r--r--tests/untried/neg/t6815.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/untried/neg/t6815.scala b/tests/untried/neg/t6815.scala
new file mode 100644
index 000000000..ff973a743
--- /dev/null
+++ b/tests/untried/neg/t6815.scala
@@ -0,0 +1,17 @@
+trait U {
+ trait ValOrDefDefApi {
+ def name: Any
+ }
+ type ValOrDefDef <: ValOrDefDefApi
+ type ValDef <: ValOrDefDef with ValDefApi { type T }
+ trait ValDefApi extends ValOrDefDefApi { this: ValDef => }
+ val emptyValDef: ValDef // the result type is volatile
+}
+
+object Test {
+ val u: U = ???
+
+ (null: Any) match {
+ case _: u.emptyValDef.T => // and, unlike in pos/t6185.scala, we shouldn't allow this.
+ }
+}