Skip to content

Commit e1023b2

Browse files
committed
Make sure symbol is completed before taking extension parameter
Needed to make sure that rawParamss is set
1 parent 3f0fed3 commit e1023b2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ object SymDenotations {
325325
case _ =>
326326
Nil
327327

328+
ensureCompleted()
328329
if rawParamss.isEmpty then recurWithoutParamss(info)
329330
else recurWithParamss(info, rawParamss)
330331
end paramSymss
@@ -339,6 +340,7 @@ object SymDenotations {
339340
case (fst :: Nil) :: _ => fst
340341
case _ => NoSymbol
341342
assert(isAllOf(ExtensionMethod))
343+
ensureCompleted()
342344
leadParam(rawParamss)
343345

344346
/** The denotation is completed: info is not a lazy type and attributes have defined values */

tests/run/collective-extensions.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ extension (x: String)
77
def bam(y: String): String = this.baz(x)(y)
88
def ban(foo: String): String = x + foo
99
def bao(y: String): String =
10-
val bam = "ABC"
10+
val bam = name
1111
x ++ y ++ bam
12+
def name: String = "ABC"
1213

1314
def app(n: Int, suffix: String): String =
1415
if n == 0 then x ++ suffix

0 commit comments

Comments
 (0)