Skip to content

Commit 0d63b0c

Browse files
authored
Merge pull request #5849 from dotty-staging/fix-#4453
Fix #4453: Avoid adding type bindings in getVariables
2 parents 0228651 + 3bec283 commit 0d63b0c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ object desugar {
14721472
val buf = new ListBuffer[VarInfo]
14731473
def seenName(name: Name) = buf exists (_._1.name == name)
14741474
def add(named: NameTree, t: Tree): Unit =
1475-
if (!seenName(named.name)) buf += ((named, t))
1475+
if (!seenName(named.name) && named.name.isTermName) buf += ((named, t))
14761476
def collect(tree: Tree): Unit = tree match {
14771477
case Bind(nme.WILDCARD, tree1) =>
14781478
collect(tree1)

tests/neg/i4453.scala

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class x0 { var x0 == _ * // error: _* can be used only for last argument // error: == cannot be used as an extractor in a pattern because it lacks an unapply or unapplySeq method
2+
// error '=' expected, but eof found

0 commit comments

Comments
 (0)