aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/t6771b.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/t6771b.scala')
-rw-r--r--tests/untried/neg/t6771b.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/untried/neg/t6771b.scala b/tests/untried/neg/t6771b.scala
new file mode 100644
index 000000000..78f11f775
--- /dev/null
+++ b/tests/untried/neg/t6771b.scala
@@ -0,0 +1,16 @@
+// Currently, the pattern matcher widens the type of the
+// scrutinee, so this doesn't typecheck. This test just
+// confirms this behaviour, although it would be an improvement
+// to change this and make this a `pos` test.
+//
+// But, to the intrepid hacker who works on this, a few notes:
+// You'll have to look into places in the pattern matcher that
+// call `dealias`, and see if they need to be `dealiasWiden`.
+// For example, if `checkableType` used only `dealias`, `pos/t6671.scala`
+// would fail.
+object Test {
+ val a = ""; var b: a.type = a
+
+ b = b match { case x => x }
+}
+