summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t6815.scala17
-rw-r--r--test/files/pos/t6815_import.scala16
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/pos/t6815.scala b/test/files/pos/t6815.scala
new file mode 100644
index 0000000000..9244b3d353
--- /dev/null
+++ b/test/files/pos/t6815.scala
@@ -0,0 +1,17 @@
+trait U {
+ trait ValOrDefDefApi {
+ def name: Any
+ }
+ type ValOrDefDef <: ValOrDefDefApi
+ type ValDef <: ValOrDefDef with ValDefApi
+ trait ValDefApi extends ValOrDefDefApi { this: ValDef => }
+ val emptyValDef: ValDef // the result type is volatile
+}
+
+object Test {
+ val u: U = ???
+
+ u.emptyValDef match {
+ case u.emptyValDef => // but we shouldn't let that stop us from treating it as a stable identifier pattern.
+ }
+}
diff --git a/test/files/pos/t6815_import.scala b/test/files/pos/t6815_import.scala
new file mode 100644
index 0000000000..56f4358d59
--- /dev/null
+++ b/test/files/pos/t6815_import.scala
@@ -0,0 +1,16 @@
+trait U {
+ trait ValOrDefDefApi {
+ def name: Any
+ }
+ type ValOrDefDef <: ValOrDefDefApi
+ type ValDef <: ValOrDefDef with ValDefApi
+ trait ValDefApi extends ValOrDefDefApi { this: ValDef => }
+ val emptyValDef: ValDef // the result type is volatile
+}
+
+object Test {
+ val u: U = ???
+
+ // but we shouldn't let that stop us from treating it as a stable identifier for import
+ import u.emptyValDef.name
+}