Skip to content

Commit 4764ae1

Browse files
authored
Merge pull request #8165 from dotty-staging/fix-#8151
Fix #8151: Make `setGivenApply` more flexible.
2 parents dcc7e8f + 8d755c2 commit 4764ae1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ object Trees {
440440
type ThisTree[-T >: Untyped] = Apply[T]
441441

442442
def isGivenApply = hasAttachment(untpd.ApplyGiven)
443-
def setGivenApply() = { pushAttachment(untpd.ApplyGiven, ()); this }
443+
def setGivenApply() = { putAttachment(untpd.ApplyGiven, ()); this }
444444
}
445445

446446
/** fun[args] */

tests/pos/i8151.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trait A
2+
trait B
3+
object O{
4+
def m(using x:A = null)(using y:B = null) = 1
5+
def n = m
6+
}

0 commit comments

Comments
 (0)