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) {
101
101
val Select (sup @ Super (_, mix), name) = sel
102
102
val sym = sel.symbol
103
103
assert(sup.symbol.exists, s " missing symbol in $sel: ${sup.tpe}" )
104
- val clazz = sup.symbol.asClass
104
+ val clazz = sup.symbol
105
105
106
106
if (sym.isTerm && ! sym.is(Method , butNot = Accessor ) && ! ctx.owner.is(ParamForwarder ))
107
107
// ParamForwaders as installed ParamForwarding.scala do use super calls to vals
108
108
ctx.error(s " super may be not be used on ${sym.underlyingSymbol}" , sel.pos)
109
109
else if (isDisallowed(sym))
110
110
ctx.error(s " super not allowed here: use this. ${sel.name} instead " , sel.pos)
111
111
else if (sym is Deferred ) {
112
- val member = sym.overridingSymbol(clazz)
112
+ val member = sym.overridingSymbol(clazz.asClass )
113
113
if (! mix.name.isEmpty ||
114
114
! member.exists ||
115
115
! ((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