Disable assertion in vertical class merger
This assertion fails for the Instabug-Android test app. The failure is harmless though: the assertion is failing because a non-abstract class does not implement all the methods from the interface it implements. This generally does not happen for input that has been generated by javac, but it may happen if the program has been optimized in advance.
Change-Id: Icfb774773bf018ca65eda598d67c7d805d90d1d6
diff --git a/src/main/java/com/android/tools/r8/shaking/VerticalClassMerger.java b/src/main/java/com/android/tools/r8/shaking/VerticalClassMerger.java
index fe10045..cabfb70 100644
--- a/src/main/java/com/android/tools/r8/shaking/VerticalClassMerger.java
+++ b/src/main/java/com/android/tools/r8/shaking/VerticalClassMerger.java
@@ -1226,8 +1226,19 @@
assert actual.isVirtualMethod() == method.isVirtualMethod();
return actual;
}
- // We will keep the method, so the class better be abstract if there is no implementation.
- assert !method.accessFlags.isAbstract() || target.accessFlags.isAbstract();
+ // The method is not actually overridden. This means that we will move `method` to the
+ // subtype. If `method` is abstract, then so should the subtype be.
+ if (Log.ENABLED) {
+ if (method.accessFlags.isAbstract() && !target.accessFlags.isAbstract()) {
+ Log.warn(
+ VerticalClassMerger.class,
+ "The non-abstract type `"
+ + target.type.toSourceString()
+ + "` does not implement the method `"
+ + method.method.toSourceString()
+ + "`.");
+ }
+ }
return null;
}