File tree Expand file tree Collapse file tree 5 files changed +6
-19
lines changed Expand file tree Collapse file tree 5 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I) extends BTypes {
214
214
private def definedClasses (sym : Symbol , phase : Phase ) =
215
215
if (sym.isDefinedInCurrentRun)
216
216
atPhase(phase) {
217
- toDenot(sym).info.decls.filter(_ .isClass)
217
+ toDenot(sym).info.decls.filter(sym => sym .isClass && ! sym.isEffectivelyErased )
218
218
}
219
219
else Nil
220
220
Original file line number Diff line number Diff line change @@ -1180,11 +1180,13 @@ object SymDenotations {
1180
1180
*/
1181
1181
final def companionModule (using Context ): Symbol =
1182
1182
if (is(Module )) sourceModule
1183
+ else if registeredCompanion.isAbsent() then NoSymbol
1183
1184
else registeredCompanion.sourceModule
1184
1185
1185
1186
private def companionType (using Context ): Symbol =
1186
1187
if (is(Package )) NoSymbol
1187
1188
else if (is(ModuleVal )) moduleClass.denot.companionType
1189
+ else if registeredCompanion.isAbsent() then NoSymbol
1188
1190
else registeredCompanion
1189
1191
1190
1192
/** The class with the same (type-) name as this module or module class,
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ object TypeErasure {
238
238
239
239
if (defn.isPolymorphicAfterErasure(sym)) eraseParamBounds(sym.info.asInstanceOf [PolyType ])
240
240
else if (sym.isAbstractType) TypeAlias (WildcardType )
241
+ else if sym.is(ConstructorProxy ) then NoType
241
242
else if (sym.isConstructor) outer.addParam(sym.owner.asClass, erase(tp)(using preErasureCtx))
242
243
else if (sym.is(Label )) erase.eraseResult(sym.info)(using preErasureCtx)
243
244
else erase.eraseInfo(tp, sym)(using preErasureCtx) match {
Original file line number Diff line number Diff line change @@ -1038,24 +1038,9 @@ object Erasure {
1038
1038
override def typedTypeDef (tdef : untpd.TypeDef , sym : Symbol )(using Context ): Tree =
1039
1039
EmptyTree
1040
1040
1041
- /** Drop all constructor proxies of members of class `cls`.
1042
- * If `cls` is itself a constructor proxy, mark it as absent after erasure.
1043
- */
1044
- private def dropConstructorProxies (cls : ClassSymbol )(using Context ) =
1045
- import Flags ._
1046
- if cls.linkedClass.is(ConstructorProxy ) then
1047
- if cls.owner.is(PackageClass ) && cls.isDefinedInCurrentRun then
1048
- cls.linkedClass.copySymDenotation(initFlags = EmptyFlags , info = NoType )
1049
- .installAfter(erasurePhase)
1050
- cls.registeredCompanion = NoSymbol
1051
- for mbr <- cls.info.decls do
1052
- if mbr.is(ConstructorProxy ) then mbr.dropAfter(erasurePhase)
1053
-
1054
1041
override def typedClassDef (cdef : untpd.TypeDef , cls : ClassSymbol )(using Context ): Tree =
1055
1042
if cls.is(Flags .Erased ) then erasedDef(cls)
1056
- else
1057
- try super .typedClassDef(cdef, cls)
1058
- finally dropConstructorProxies(cls)
1043
+ else super .typedClassDef(cdef, cls)
1059
1044
1060
1045
override def typedAnnotated (tree : untpd.Annotated , pt : Type )(using Context ): Tree =
1061
1046
typed(tree.arg, pt)
Original file line number Diff line number Diff line change @@ -446,8 +446,7 @@ class TreeChecker extends Phase with SymTransformer {
446
446
val decls = cls.classInfo.decls.toList.toSet.filter(isNonMagicalMember)
447
447
val defined = impl.body.map(_.symbol)
448
448
449
- def isAllowed (sym : Symbol ): Boolean =
450
- sym.is(ConstructorProxy ) && ! ctx.phase.erasedTypes
449
+ def isAllowed (sym : Symbol ): Boolean = sym.is(ConstructorProxy )
451
450
452
451
val symbolsNotDefined = (decls -- defined - constr.symbol).filterNot(isAllowed)
453
452
You can’t perform that action at this time.
0 commit comments