Skip default methods on single abstract method search

Fix for KT-4886: SAM conversion doesn't work for interfaces with default methods

  #KT-4886 Fixed
This commit is contained in:
Michael Bogdanov
2014-10-09 14:14:56 +04:00
parent 062dda89ea
commit 1944f75802
@@ -339,6 +339,12 @@ public class SingleAbstractMethodUtils {
return true;
}
for (JavaMethod method : javaClass.getMethods()) {
//skip java 8 default methods
if (!method.isAbstract()) {
continue;
}
if (DescriptorResolverUtils.isObjectMethod(method)) { // e.g., ignore toString() declared in interface
continue;
}