Skip to content

Commit c4ebabb

Browse files
committed
ditch add interfaces
1 parent 9c7236d commit c4ebabb

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BCodeAsmCommon.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,17 +429,17 @@ final class BCodeAsmCommon[G <: Global](val global: G) {
429429
// impl class after mixin. So the filter in mixin is not exactly what we need here (we
430430
// want to identify concrete trait methods, not any accessors). So we check some symbol
431431
// properties manually.
432-
val traitMethodWithStaticImplementation = {
433-
import symtab.Flags._
434-
classSym.isTrait && !classSym.isImplClass &&
435-
erasure.needsImplMethod(methodSym) &&
436-
!methodSym.isModule &&
437-
!(methodSym hasFlag (ACCESSOR | SUPERACCESSOR))
438-
}
432+
// val traitMethodWithStaticImplementation = {
433+
// import symtab.Flags._
434+
// classSym.isTrait && !classSym.isImplClass &&
435+
// erasure.needsImplMethod(methodSym) &&
436+
// !methodSym.isModule &&
437+
// !(methodSym hasFlag (ACCESSOR | SUPERACCESSOR))
438+
// }
439439

440440
val info = MethodInlineInfo(
441441
effectivelyFinal = effectivelyFinal,
442-
traitMethodWithStaticImplementation = traitMethodWithStaticImplementation,
442+
traitMethodWithStaticImplementation = false, //traitMethodWithStaticImplementation,
443443
annotatedInline = methodSym.hasAnnotation(ScalaInlineClass),
444444
annotatedNoInline = methodSym.hasAnnotation(ScalaNoInlineClass)
445445
)

src/compiler/scala/tools/nsc/transform/Erasure.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import symtab._
1212
import Flags._
1313
import scala.reflect.internal.Mode._
1414

15-
abstract class Erasure extends AddInterfaces
16-
with scala.reflect.internal.transform.Erasure
15+
abstract class Erasure extends scala.reflect.internal.transform.Erasure
1716
with typechecker.Analyzer
1817
with TypingTransformers
1918
with ast.TreeDSL
@@ -373,8 +372,8 @@ abstract class Erasure extends AddInterfaces
373372
* - For Array[T].<init> : {scala#Int)Array[T]
374373
* - For a type parameter : A type bounds type consisting of the erasures of its bounds.
375374
*/
376-
override def transformInfo(sym: Symbol, tp: Type): Type =
377-
transformMixinInfo(super.transformInfo(sym, tp))
375+
// override def transformInfo(sym: Symbol, tp: Type): Type =
376+
// transformMixinInfo(super.transformInfo(sym, tp))
378377

379378
val deconstMap = new TypeMap {
380379
// For some reason classOf[Foo] creates ConstantType(Constant(tpe)) with an actual Type for tpe,
@@ -1161,10 +1160,10 @@ abstract class Erasure extends AddInterfaces
11611160
val tree1 = preTransformer.transform(tree)
11621161
// log("tree after pretransform: "+tree1)
11631162
exitingErasure {
1164-
val tree2 = mixinTransformer.transform(tree1)
1163+
//val tree2 = mixinTransformer.transform(tree1)
11651164
// debuglog("tree after addinterfaces: \n" + tree2)
11661165

1167-
newTyper(rootContextPostTyper(unit, tree)).typed(tree2)
1166+
newTyper(rootContextPostTyper(unit, tree)).typed(tree1)
11681167
}
11691168
}
11701169
}

0 commit comments

Comments
 (0)