File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,15 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
101101 val Select (sup @ Super (_, mix), name) = sel
102102 val sym = sel.symbol
103103 assert(sup.symbol.exists, s " missing symbol in $sel: ${sup.tpe}" )
104- val clazz = sup.symbol.asClass
104+ val clazz = sup.symbol
105105
106106 if (sym.isTerm && ! sym.is(Method , butNot = Accessor ) && ! ctx.owner.is(ParamForwarder ))
107107 // ParamForwaders as installed ParamForwarding.scala do use super calls to vals
108108 ctx.error(s " super may be not be used on ${sym.underlyingSymbol}" , sel.pos)
109109 else if (isDisallowed(sym))
110110 ctx.error(s " super not allowed here: use this. ${sel.name} instead " , sel.pos)
111111 else if (sym is Deferred ) {
112- val member = sym.overridingSymbol(clazz)
112+ val member = sym.overridingSymbol(clazz.asClass )
113113 if (! mix.name.isEmpty ||
114114 ! member.exists ||
115115 ! ((member is AbsOverride ) && member.isIncompleteIn(clazz)))
Original file line number Diff line number Diff line change 1+ trait Foo {
2+ def foo = 4
3+ }
4+ object Bar extends Foo {
5+ inline def bar = super [Foo ].foo // error
6+ }
7+ object Main {
8+ Bar .bar
9+ }
You can’t perform that action at this time.
0 commit comments