aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala2
-rw-r--r--tests/pos/i1868.scala7
2 files changed, 8 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index fe158dfe2..6dd3f45fc 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1150,7 +1150,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
// classes defined in a such arguments should not be entered into the
// enclosing class.
c.exprContext(mdef, exprOwner)
- case None => c
+ case _ => c
}
}
// necessary in order to mark the typed ahead annotations as definitely typed:
diff --git a/tests/pos/i1868.scala b/tests/pos/i1868.scala
new file mode 100644
index 000000000..3ca3e0094
--- /dev/null
+++ b/tests/pos/i1868.scala
@@ -0,0 +1,7 @@
+class Test[X](x: X) {
+ def checkSpecialization[Y](y: Y): X = {
+ def specMe[@specialized T]() = ()
+ x
+ }
+ private def checkNameStartsWith(prefix: String) = { (new Exception) }
+}