@@ -96,11 +96,6 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
9696 * scala.Null is mapped to scala.runtime.Null$. This is because there exist no class files
9797 * for the Nothing / Null. If used for example as a parameter type, we use the runtime classes
9898 * in the classfile method signature.
99- *
100- * Note that the referenced class symbol may be an implementation class. For example when
101- * compiling a mixed-in method that forwards to the static method in the implementation class,
102- * the class descriptor of the receiver (the implementation class) is obtained by creating the
103- * ClassBType.
10499 */
105100 final def classBTypeFromSymbol (classSym : Symbol ): ClassBType = {
106101 assert(classSym != NoSymbol , " Cannot create ClassBType from NoSymbol" )
@@ -159,9 +154,6 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
159154
160155 /**
161156 * This method returns the BType for a type reference, for example a parameter type.
162- *
163- * If `t` references a class, typeToBType ensures that the class is not an implementation class.
164- * See also comment on classBTypeFromSymbol, which is invoked for implementation classes.
165157 */
166158 final def typeToBType (t : Type ): BType = {
167159 import definitions .ArrayClass
@@ -264,12 +256,12 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
264256 * current phase, for example, after lambdalift, all local classes become member of the enclosing
265257 * class.
266258 *
267- * Impl classes are always considered top-level, see comment in BTypes.
259+ * Specialized classes are always considered top-level, see comment in BTypes.
268260 */
269261 private def memberClassesForInnerClassTable (classSymbol : Symbol ): List [Symbol ] = classSymbol.info.decls.collect({
270262 case sym if sym.isClass && ! considerAsTopLevelImplementationArtifact(sym) =>
271263 sym
272- case sym if sym.isModule && ! considerAsTopLevelImplementationArtifact(sym) => // impl classes get the lateMODULE flag in mixin
264+ case sym if sym.isModule && ! considerAsTopLevelImplementationArtifact(sym) =>
273265 val r = exitingPickler(sym.moduleClass)
274266 assert(r != NoSymbol , sym.fullLocationString)
275267 r
@@ -317,7 +309,6 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
317309 )
318310 }
319311
320- // Check for isImplClass: trait implementation classes have NoSymbol as superClass
321312 // Check for hasAnnotationFlag for SI-9393: the classfile / java source parsers add
322313 // scala.annotation.Annotation as superclass to java annotations. In reality, java
323314 // annotation classfiles have superclass Object (like any interface classfile).
@@ -380,8 +371,8 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
380371 }
381372
382373 val companionModuleMembers = if (considerAsTopLevelImplementationArtifact(classSym)) Nil else {
383- // If this is a top-level non-impl (*) class, the member classes of the companion object are
384- // added as members of the class. For example:
374+ // If this is a top-level class, the member classes of the companion object are added as
375+ // members of the class. For example:
385376 // class C { }
386377 // object C {
387378 // class D
@@ -392,11 +383,6 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
392383 // (done by buildNestedInfo). See comment in BTypes.
393384 // For consistency, the InnerClass entry for D needs to be present in C - to Java it looks
394385 // like D is a member of C, not C$.
395- //
396- // (*) We exclude impl classes: if the classfile for the impl class exists on the classpath,
397- // a linkedClass symbol is found for which isTopLevelModule is true, so we end up searching
398- // members of that weird impl-class-module-class-symbol. that search probably cannot return
399- // any classes, but it's better to exclude it.
400386 val javaCompatMembers = {
401387 if (linkedClass != NoSymbol && isTopLevelModuleClass(linkedClass))
402388 // phase travel to exitingPickler: this makes sure that memberClassesForInnerClassTable only sees member
@@ -454,7 +440,7 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
454440 assert(innerClassSym.isClass, s " Cannot build NestedInfo for non-class symbol $innerClassSym" )
455441
456442 val isTopLevel = innerClassSym.rawowner.isPackageClass
457- // impl classes are considered top-level, see comment in BTypes
443+ // specialized classes are considered top-level, see comment in BTypes
458444 if (isTopLevel || considerAsTopLevelImplementationArtifact(innerClassSym)) None
459445 else if (innerClassSym.rawowner.isTerm) {
460446 // This case should never be reached: the lambdalift phase mutates the rawowner field of all
@@ -592,17 +578,11 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes {
592578
593579 /**
594580 * True for module classes of modules that are top-level or owned only by objects. Module classes
595- * for such objects will get a MODULE$ flag and a corresponding static initializer.
581+ * for such objects will get a MODULE$ field and a corresponding static initializer.
596582 */
597583 final def isStaticModuleClass (sym : Symbol ): Boolean = {
598- /* (1) Phase travel to to pickler is required to exclude implementation classes; they have the
599- * lateMODULEs after mixin, so isModuleClass would be true.
600- * (2) isStaticModuleClass is a source-level property. See comment on isOriginallyStaticOwner.
601- */
602- exitingPickler { // (1)
603- sym.isModuleClass &&
604- isOriginallyStaticOwner(sym.originalOwner) // (2)
605- }
584+ sym.isModuleClass &&
585+ isOriginallyStaticOwner(sym.originalOwner) // isStaticModuleClass is a source-level property, see comment on isOriginallyStaticOwner
606586 }
607587
608588 // legacy, to be removed when the @remote annotation gets removed
0 commit comments