Skip to content

Commit 0cc3ac5

Browse files
committed
add comment to code change
1 parent 0b20a04 commit 0cc3ac5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

+2
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,8 @@ class Typer extends Namer
13001300
case _ =>
13011301
if (tree.name == nme.WILDCARD) body1
13021302
else {
1303+
// for a singleton pattern like `x @ Nil`, `x` should get the type from the scrutinee
1304+
// see tests/neg/3200b.scala and SI-1503
13031305
val symTp =
13041306
if (body1.tpe.isInstanceOf[TermRef]) pt1
13051307
else body1.tpe.underlyingIfRepeated(isJava = false)

0 commit comments

Comments
 (0)