Report unmet trait requirements

#KT-3006 Fixed
This commit is contained in:
Alexander Udalov
2014-08-11 12:26:17 +04:00
parent 18ca935558
commit 47d5f83d04
19 changed files with 234 additions and 14 deletions
@@ -226,7 +226,7 @@ public class DescriptorUtils {
return false;
}
public static boolean isEnumClass(@NotNull DeclarationDescriptor descriptor) {
public static boolean isEnumClass(@Nullable DeclarationDescriptor descriptor) {
return isKindOf(descriptor, ClassKind.ENUM_CLASS);
}
@@ -822,6 +822,10 @@ public class KotlinBuiltIns {
return fqNames.any.equals(fqName) || fqNames.nothing.equals(fqName);
}
public boolean isAny(@NotNull ClassDescriptor descriptor) {
return fqNames.any.equals(DescriptorUtils.getFqName(descriptor));
}
public boolean isNothing(@NotNull JetType type) {
return isNothingOrNullableNothing(type)
&& !type.isNullable();