File tree 1 file changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/typer 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,20 @@ trait NamerContextOps { this: Context =>
103
103
104
104
/** A new context for the interior of a class */
105
105
def inClassContext (selfInfo : DotClass /* Should be Type | Symbol*/ ): Context = {
106
- val localCtx : Context = ctx.fresh.setNewScope
106
+ var localCtx : FreshContext = ctx.fresh.setNewScope
107
107
selfInfo match {
108
108
case sym : Symbol if sym.exists && sym.name != nme.WILDCARD => localCtx.scope.openForMutations.enter(sym)
109
109
case _ =>
110
110
}
111
+ if (ctx.owner.is(Module )) {
112
+ val opaq = ctx.owner.companionOpaqueType
113
+ opaq.getAnnotation(defn.OpaqueAliasAnnot ) match {
114
+ case Some (Annotation .OpaqueAlias (rhs)) =>
115
+ localCtx = localCtx.setFreshGADTBounds
116
+ localCtx.gadt.setBounds(opaq, TypeAlias (rhs))
117
+ case _ =>
118
+ }
119
+ }
111
120
localCtx
112
121
}
113
122
@@ -506,7 +515,6 @@ class Namer { typer: Typer =>
506
515
case _ =>
507
516
}
508
517
509
-
510
518
def setDocstring (sym : Symbol , tree : Tree )(implicit ctx : Context ) = tree match {
511
519
case t : MemberDef if t.rawComment.isDefined =>
512
520
ctx.docCtx.foreach(_.addDocstring(sym, t.rawComment))
You can’t perform that action at this time.
0 commit comments