File tree 1 file changed +13
-1
lines changed
src/compiler/scala/tools/nsc/backend/jvm
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -308,6 +308,18 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
308
308
309
309
private var innerClassBuffer = mutable.LinkedHashSet [Symbol ]()
310
310
311
+ /** Drop redundant interfaces (ones which are implemented by some
312
+ * other parent) from the immediate parents. This is important on
313
+ * android because there is otherwise an interface explosion.
314
+ */
315
+ private def minimizeInterfaces (interfaces : List [Symbol ]): List [Symbol ] = (
316
+ interfaces filterNot (int1 =>
317
+ interfaces exists (int2 =>
318
+ (int1 ne int2) && (int2 isSubClass int1)
319
+ )
320
+ )
321
+ )
322
+
311
323
def genClass (c : IClass ) {
312
324
clasz = c
313
325
innerClassBuffer.clear()
@@ -322,7 +334,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
322
334
}
323
335
val ifaces = superInterfaces match {
324
336
case Nil => JClass .NO_INTERFACES
325
- case _ => mkArray(superInterfaces map (x => javaName(x .typeSymbol)))
337
+ case _ => mkArray(minimizeInterfaces( superInterfaces map (_ .typeSymbol)) map javaName )
326
338
}
327
339
328
340
jclass = fjbgContext.JClass (javaFlags(c.symbol),
You can’t perform that action at this time.
0 commit comments