File tree 2 files changed +3
-4
lines changed
compiler/src/dotty/tools/dotc 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,6 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
192
192
}
193
193
else
194
194
transformSelect(tree, Nil )
195
- case tree : Super =>
196
- if (ctx.owner.enclosingMethod.isInlinedMethod)
197
- ctx.error(SuperCallsNotAllowedInline (ctx.owner), tree.pos)
198
- super .transform(tree)
199
195
case tree : Apply =>
200
196
methPart(tree) match {
201
197
case Select (nu : New , nme.CONSTRUCTOR ) if isCheckable(nu) =>
Original file line number Diff line number Diff line change @@ -476,6 +476,9 @@ class Typer extends Namer
476
476
case pt : SelectionProto if pt.name == nme.CONSTRUCTOR => true
477
477
case _ => false
478
478
}
479
+ val enclosingInlineable = ctx.owner.ownersIterator.findSymbol(_.isInlineableMethod)
480
+ if (enclosingInlineable.exists && ! Inliner .isLocal(qual1.symbol, enclosingInlineable))
481
+ ctx.error(SuperCallsNotAllowedInline (enclosingInlineable), tree.pos)
479
482
pt match {
480
483
case pt : SelectionProto if pt.name.isTypeName =>
481
484
qual1 // don't do super references for types; they are meaningless anyway
You can’t perform that action at this time.
0 commit comments