@@ -25,6 +25,7 @@ import ast.{TreeTypeMap, Trees, tpd, untpd}
25
25
import Trees ._
26
26
import Decorators ._
27
27
import transform .SymUtils ._
28
+ import config .Config
28
29
29
30
import dotty .tools .tasty .{TastyBuffer , TastyReader }
30
31
import TastyBuffer ._
@@ -570,6 +571,7 @@ class TreeUnpickler(reader: TastyReader,
570
571
ctx.newSymbol(ctx.owner, name, flags, completer, privateWithin, coord)
571
572
}
572
573
sym.annotations = annotFns.map(_(sym))
574
+ if sym.isOpaqueAlias then sym.setFlag(Deferred )
573
575
ctx.owner match {
574
576
case cls : ClassSymbol => cls.enter(sym)
575
577
case _ =>
@@ -832,11 +834,14 @@ class TreeUnpickler(reader: TastyReader,
832
834
override def completerTypeParams (sym : Symbol )(implicit ctx : Context ) =
833
835
rhs.tpe.typeParams
834
836
}
835
- sym.info = rhs.tpe match {
837
+ val rinfo = rhs.tpe match
836
838
case _ : TypeBounds | _ : ClassInfo => checkNonCyclic(sym, rhs.tpe, reportErrors = false )
837
839
case _ => rhs.tpe.toBounds
838
- }
839
- sym.normalizeOpaque()
840
+ sym.info = if Config .newScheme then sym.opaqueToBounds(rinfo) else rinfo
841
+ if Config .newScheme then
842
+ if sym.isOpaqueAlias then
843
+ sym.typeRef.recomputeDenot() // make sure we see the new bounds from now on
844
+ else sym.normalizeOpaque()
840
845
sym.resetFlag(Provisional )
841
846
TypeDef (rhs)
842
847
}
@@ -905,8 +910,10 @@ class TreeUnpickler(reader: TastyReader,
905
910
}
906
911
else EmptyValDef
907
912
cls.setNoInitsFlags(parentsKind(parents), bodyFlags)
908
- cls.info = ClassInfo (cls.owner.thisType, cls, parentTypes, cls.unforcedDecls,
909
- if (self.isEmpty) NoType else self.tpt.tpe)
913
+ val cinfo = ClassInfo (
914
+ cls.owner.thisType, cls, parentTypes, cls.unforcedDecls,
915
+ selfInfo = if (self.isEmpty) NoType else self.tpt.tpe)
916
+ cls.info = if Config .newScheme then cinfo.integrateOpaqueMembers else cinfo
910
917
val constr = readIndexedDef().asInstanceOf [DefDef ]
911
918
val mappedParents = parents.map(_.changeOwner(localDummy, constr.symbol))
912
919
0 commit comments