Skip to content

Commit 984e6df

Browse files
committed
Fix ASF call in ResolveSuper
1 parent d40009a commit 984e6df

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

Diff for: compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ object ResolveSuper {
109109
sym = other.symbol
110110
// Having a matching denotation is not enough: it should also be a subtype
111111
// of the superaccessor's type, see i5433.scala for an example where this matters
112-
val otherTp = other.asSeenFrom(base.typeRef).info
113-
val accTp = acc.asSeenFrom(base.typeRef).info
112+
val otherTp = other.asSeenFrom(base.thisType).info
113+
val accTp = acc.asSeenFrom(base.thisType).info
114114
// Since the super class can be Java defined,
115115
// we use relaxed overriding check for explicit nulls if one of the symbols is Java defined.
116116
// This forces `Null` to be a subtype of non-primitive value types during override checking.

Diff for: tests/pos/i22062.scala

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
class Label
2+
class Component
3+
4+
trait RenderableCellsCompanion:
5+
type Renderer[-A] <: CellRenderer[A]
6+
type DefaultRenderer[-A] <: Label & Renderer[A]
7+
8+
trait CellRendererCompanion:
9+
type CellInfo
10+
def labeled[A](): DefaultRenderer[A]
11+
protected trait LabelRenderer[-A] extends CellRenderer[A]:
12+
override abstract def componentFor(info: companion.CellInfo): Component = super.componentFor(info)
13+
14+
trait CellRenderer[-A]:
15+
val companion: CellRendererCompanion
16+
def componentFor(cellInfo: companion.CellInfo): Component
17+
18+
sealed trait TreeRenderers extends RenderableCellsCompanion:
19+
this: Tree.type =>
20+
21+
trait Renderer[-A] extends CellRenderer[A]:
22+
final override val companion = Renderer
23+
24+
object Renderer extends CellRendererCompanion:
25+
final override class CellInfo
26+
override def labeled[A]() = new DefaultRenderer[A] with LabelRenderer[A] {}
27+
28+
class DefaultRenderer[-A] extends Label with Renderer[A]:
29+
override def componentFor(info: Renderer.CellInfo): Component = ???
30+
31+
class Tree extends Component
32+
object Tree extends TreeRenderers

0 commit comments

Comments
 (0)