Skip to content

Commit 135cb9b

Browse files
authored
Merge pull request #13018 from dotty-staging/fix-12897
Add missing case for finding default getters
2 parents f9c9421 + 9c0e4d2 commit 135cb9b

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ object Applications {
210210
case Select(receiver, _) => receiver
211211
case mr => mr.tpe.normalizedPrefix match {
212212
case mr: TermRef => ref(mr)
213+
case mr: ThisType => singleton(mr)
213214
case mr =>
214215
if testOnly then
215216
// In this case it is safe to skolemize now; we will produce a stable prefix for the actual call.

tests/pos/i12897/A.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
package TestFoo
3+
extension (text : String) def foo(defaultArg : Boolean = true) : String = ""
4+
5+
//def foo(text : String) (defaultArg : Boolean = true) : String = ""

tests/pos/i12897/B.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
package TestFoo
3+
4+
val f = "123".foo() //error

0 commit comments

Comments
 (0)