fix a case of fake override of abstract and non-abstract function
===
open class Ccc() {
fun foo() = 1
}
trait Ttt {
fun foo(): Int
}
class Zzz() : Ccc(), Ttt // there must not be an error here
===
Reported by Andrey Breslav as a bug of Comparator implementation:
===
fun comparator<T>(f: (T, T) -> Int): Comparator<T> = object : Comparator<T>, Object() {
override fun compare(o1: T, o2: T): Int = f(o1, o2)
}
===
This commit is contained in:
@@ -357,7 +357,15 @@ public class OverrideResolver {
|
||||
abstractNoImpl.add(single);
|
||||
}
|
||||
} else {
|
||||
manyImpl.addAll(overridenDeclarations);
|
||||
List<CallableMemberDescriptor> nonAbstractManyImpl = Lists.newArrayList();
|
||||
for (CallableMemberDescriptor overriden : overridenDeclarations) {
|
||||
if (overriden.getModality() != Modality.ABSTRACT) {
|
||||
nonAbstractManyImpl.add(overriden);
|
||||
}
|
||||
}
|
||||
if (nonAbstractManyImpl.size() > 1) {
|
||||
manyImpl.addAll(nonAbstractManyImpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
open class Ccc() {
|
||||
fun foo() = 1
|
||||
}
|
||||
|
||||
trait Ttt {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
class Zzz() : Ccc(), Ttt
|
||||
Reference in New Issue
Block a user