Check if the class is special by FQ name

This is needed because our built-ins can be loaded with two different
mechanisms (deserialization and lazy resolve) and, when that happens,
corresponding descriptors aren't equal to each other, so one of two resolved
descriptors for Any (or the same with Nothing) was never considered to be a
"special class" with no supertypes
This commit is contained in:
Alexander Udalov
2014-02-04 19:39:16 +04:00
parent 3e33473c1a
commit 304129f9c9
5 changed files with 12 additions and 18 deletions
@@ -235,8 +235,7 @@ public class DescriptorValidator {
Collection<JetType> supertypes = descriptor.getTypeConstructor().getSupertypes();
if (supertypes.isEmpty() && descriptor.getKind() != ClassKind.TRAIT
&& KotlinBuiltIns.getInstance().getAny() != descriptor
&& KotlinBuiltIns.getInstance().getNothing() != descriptor) {
&& !KotlinBuiltIns.isSpecialClassWithNoSupertypes(descriptor)) {
report(collector, descriptor, "No supertypes for non-trait");
}
validateTypes(descriptor, collector, supertypes);