Rename KotlinBuiltIns.isAny -> isAnyOrNullableAny

Reduce confusion, prevent bugs
This commit is contained in:
Alexander Udalov
2013-12-11 18:03:20 +04:00
parent 0576851102
commit cc1d4a033a
6 changed files with 7 additions and 6 deletions
@@ -939,7 +939,7 @@ public class KotlinBuiltIns {
&& type.getConstructor() == getNothing().getTypeConstructor();
}
public boolean isAny(@NotNull JetType type) {
public boolean isAnyOrNullableAny(@NotNull JetType type) {
return !(type instanceof NamespaceType) &&
type.getConstructor() == getAny().getTypeConstructor();
}
@@ -636,7 +636,8 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
if (!klass.equals(KotlinBuiltIns.getInstance().getNothing())) {
Collection<JetType> supertypes = klass.getTypeConstructor().getSupertypes();
if (supertypes.isEmpty() || !alwaysRenderAny && supertypes.size() == 1 && KotlinBuiltIns.getInstance().isAny(supertypes.iterator().next())) {
if (supertypes.isEmpty() || !alwaysRenderAny && supertypes.size() == 1 && KotlinBuiltIns.getInstance().isAnyOrNullableAny(
supertypes.iterator().next())) {
}
else {
builder.append(" : ");