Skip to content

Commit 19b4216

Browse files
authored
Merge pull request #7315 from dotty-staging/fix-#7247
Fix #7247: Align isVarPattern and patternVar
2 parents 0e1c29d + 48786d1 commit 19b4216

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ object desugar {
11081108

11091109
/** Expand variable identifier x to x @ _ */
11101110
def patternVar(tree: Tree)(implicit ctx: Context): Bind = {
1111-
val Ident(name) = tree
1111+
val Ident(name) = unsplice(tree)
11121112
Bind(name, Ident(nme.WILDCARD)).withSpan(tree.span)
11131113
}
11141114

tests/neg/i7247.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
val x = "foo" match
2+
case _: (a *: (b: Any)) => ??? // error

0 commit comments

Comments
 (0)