@@ -265,8 +265,8 @@ class Semantic {
265
265
def call (meth : Symbol , args : List [ArgInfo ], superType : Type , source : Tree ): Contextual [Result ] =
266
266
value.call(meth, args, superType, source) ++ errors
267
267
268
- def instantiate (klass : ClassSymbol , ctor : Symbol , args : List [ArgInfo ], source : Tree , inside : ClassSymbol ): Contextual [Result ] =
269
- value.instantiate(klass, ctor, args, source, inside ) ++ errors
268
+ def instantiate (klass : ClassSymbol , ctor : Symbol , args : List [ArgInfo ], source : Tree ): Contextual [Result ] =
269
+ value.instantiate(klass, ctor, args, source) ++ errors
270
270
}
271
271
272
272
/** The state that threads through the interpreter */
@@ -450,7 +450,7 @@ class Semantic {
450
450
}
451
451
452
452
/** Handle a new expression `new p.C` where `p` is abstracted by `value` */
453
- def instantiate (klass : ClassSymbol , ctor : Symbol , args : List [ArgInfo ], source : Tree , inside : ClassSymbol ): Contextual [Result ] = log(" instantiating " + klass.show + " , value = " + value + " , args = " + args, printer, res => res.asInstanceOf [Result ].show) {
453
+ def instantiate (klass : ClassSymbol , ctor : Symbol , args : List [ArgInfo ], source : Tree ): Contextual [Result ] = log(" instantiating " + klass.show + " , value = " + value + " , args = " + args, printer, res => res.asInstanceOf [Result ].show) {
454
454
val trace1 = trace.add(source)
455
455
if promoted.isCurrentObjectPromoted then Result (Hot , Nil )
456
456
else value match {
@@ -489,15 +489,15 @@ class Semantic {
489
489
490
490
// Approximate instances of local classes inside secondary constructor as Cold.
491
491
// This way, we avoid complicating the domain for Warm unnecessarily
492
- if klass.isContainedIn(inside) && inSecondaryConstructor(klass.owner) then Result (Cold , res.errors)
492
+ if inSecondaryConstructor(klass.owner) then Result (Cold , res.errors)
493
493
else Result (value, res.errors)
494
494
495
495
case Fun (body, thisV, klass, env) =>
496
496
report.error(" unexpected tree in instantiating a function, fun = " + body.show, source)
497
497
Result (Hot , Nil )
498
498
499
499
case RefSet (refs) =>
500
- val resList = refs.map(_.instantiate(klass, ctor, args, source, inside ))
500
+ val resList = refs.map(_.instantiate(klass, ctor, args, source))
501
501
val value2 = resList.map(_.value).join
502
502
val errors = resList.flatMap(_.errors)
503
503
Result (value2, errors)
@@ -743,7 +743,7 @@ class Semantic {
743
743
val trace2 = trace.add(expr)
744
744
locally {
745
745
given Trace = trace2
746
- (res ++ errors).instantiate(cls, ctor, args, source = expr, inside = klass )
746
+ (res ++ errors).instantiate(cls, ctor, args, source = expr)
747
747
}
748
748
749
749
case Call (ref, argss) =>
0 commit comments