rename: isSealed -> isFinal
This commit is contained in:
+1
-1
@@ -348,7 +348,7 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSealed() {
|
public boolean isFinal() {
|
||||||
return !getModality().isOverridable();
|
return !getModality().isOverridable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ public class BodyResolver {
|
|||||||
trace.report(SUPERTYPE_APPEARS_TWICE.on(typeReference));
|
trace.report(SUPERTYPE_APPEARS_TWICE.on(typeReference));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (constructor.isSealed() && !allowedFinalSupertypes.contains(constructor)) {
|
if (constructor.isFinal() && !allowedFinalSupertypes.contains(constructor)) {
|
||||||
trace.report(FINAL_SUPERTYPE.on(typeReference));
|
trace.report(FINAL_SUPERTYPE.on(typeReference));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -461,7 +461,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSealed() {
|
public boolean isFinal() {
|
||||||
return !getModality().isOverridable();
|
return !getModality().isOverridable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -163,7 +163,7 @@ public abstract class AbstractLazyTypeParameterDescriptor implements TypeParamet
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSealed() {
|
public boolean isFinal() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@ public class ClassDescriptorImpl extends DeclarationDescriptorNonRootImpl implem
|
|||||||
|
|
||||||
|
|
||||||
public final ClassDescriptorImpl initialize(
|
public final ClassDescriptorImpl initialize(
|
||||||
boolean sealed,
|
boolean isFinal,
|
||||||
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
@NotNull List<? extends TypeParameterDescriptor> typeParameters,
|
||||||
@NotNull Collection<JetType> supertypes,
|
@NotNull Collection<JetType> supertypes,
|
||||||
@NotNull JetScope memberDeclarations,
|
@NotNull JetScope memberDeclarations,
|
||||||
@@ -73,7 +73,7 @@ public class ClassDescriptorImpl extends DeclarationDescriptorNonRootImpl implem
|
|||||||
@Nullable ConstructorDescriptor primaryConstructor,
|
@Nullable ConstructorDescriptor primaryConstructor,
|
||||||
boolean isInner
|
boolean isInner
|
||||||
) {
|
) {
|
||||||
this.typeConstructor = new TypeConstructorImpl(this, getAnnotations(), sealed, getName().asString(), typeParameters, supertypes);
|
this.typeConstructor = new TypeConstructorImpl(this, getAnnotations(), isFinal, getName().asString(), typeParameters, supertypes);
|
||||||
this.memberDeclarations = memberDeclarations;
|
this.memberDeclarations = memberDeclarations;
|
||||||
this.constructors = constructors;
|
this.constructors = constructors;
|
||||||
this.primaryConstructor = primaryConstructor;
|
this.primaryConstructor = primaryConstructor;
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor {
|
|||||||
typeConstructor = new TypeConstructorImpl(
|
typeConstructor = new TypeConstructorImpl(
|
||||||
this,
|
this,
|
||||||
originalTypeConstructor.getAnnotations(),
|
originalTypeConstructor.getAnnotations(),
|
||||||
originalTypeConstructor.isSealed(),
|
originalTypeConstructor.isFinal(),
|
||||||
originalTypeConstructor.toString(),
|
originalTypeConstructor.toString(),
|
||||||
typeParameters,
|
typeParameters,
|
||||||
supertypes
|
supertypes
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ public abstract class NumberValueTypeConstructor implements TypeConstructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSealed() {
|
public boolean isFinal() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class IntersectionTypeConstructor extends AnnotatedImpl implements TypeCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSealed() {
|
public boolean isFinal() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,10 @@ public interface TypeConstructor extends Annotated {
|
|||||||
@NotNull
|
@NotNull
|
||||||
Collection<JetType> getSupertypes();
|
Collection<JetType> getSupertypes();
|
||||||
|
|
||||||
boolean isSealed();
|
/**
|
||||||
|
* Cannot have subtypes.
|
||||||
|
*/
|
||||||
|
boolean isFinal();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the type is non-denotable, it can't be written in code directly, it only can appear internally inside a type checker.
|
* If the type is non-denotable, it can't be written in code directly, it only can appear internally inside a type checker.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class TypeConstructorImpl extends AnnotatedImpl implements TypeConstructo
|
|||||||
private final List<TypeParameterDescriptor> parameters;
|
private final List<TypeParameterDescriptor> parameters;
|
||||||
private Collection<JetType> supertypes;
|
private Collection<JetType> supertypes;
|
||||||
private final String debugName;
|
private final String debugName;
|
||||||
private final boolean sealed;
|
private final boolean isFinal;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private final ClassifierDescriptor classifierDescriptor;
|
private final ClassifierDescriptor classifierDescriptor;
|
||||||
@@ -40,13 +40,13 @@ public class TypeConstructorImpl extends AnnotatedImpl implements TypeConstructo
|
|||||||
public TypeConstructorImpl(
|
public TypeConstructorImpl(
|
||||||
@Nullable ClassifierDescriptor classifierDescriptor,
|
@Nullable ClassifierDescriptor classifierDescriptor,
|
||||||
@NotNull List<AnnotationDescriptor> annotations,
|
@NotNull List<AnnotationDescriptor> annotations,
|
||||||
boolean sealed,
|
boolean isFinal,
|
||||||
@NotNull String debugName,
|
@NotNull String debugName,
|
||||||
@NotNull List<? extends TypeParameterDescriptor> parameters,
|
@NotNull List<? extends TypeParameterDescriptor> parameters,
|
||||||
@NotNull Collection<JetType> supertypes) {
|
@NotNull Collection<JetType> supertypes) {
|
||||||
super(annotations);
|
super(annotations);
|
||||||
this.classifierDescriptor = classifierDescriptor;
|
this.classifierDescriptor = classifierDescriptor;
|
||||||
this.sealed = sealed;
|
this.isFinal = isFinal;
|
||||||
this.debugName = debugName;
|
this.debugName = debugName;
|
||||||
this.parameters = Collections.unmodifiableList(new ArrayList<TypeParameterDescriptor>(parameters));
|
this.parameters = Collections.unmodifiableList(new ArrayList<TypeParameterDescriptor>(parameters));
|
||||||
this.supertypes = Collections.unmodifiableCollection(supertypes);
|
this.supertypes = Collections.unmodifiableCollection(supertypes);
|
||||||
@@ -70,8 +70,8 @@ public class TypeConstructorImpl extends AnnotatedImpl implements TypeConstructo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSealed() {
|
public boolean isFinal() {
|
||||||
return sealed;
|
return isFinal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public class TypeUtils {
|
|||||||
if (type.isNullable()) {
|
if (type.isNullable()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!type.getConstructor().isSealed()) {
|
if (!type.getConstructor().isFinal()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user