Make constructor of JetTypeImpl private, introduce factory methods
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ public class SingleAbstractMethodUtils {
|
||||
}
|
||||
ClassifierDescriptor classifier = functionType.getConstructor().getDeclarationDescriptor();
|
||||
assert classifier instanceof ClassDescriptor : "Not class: " + classifier;
|
||||
return new JetTypeImpl(
|
||||
return JetTypeImpl.create(
|
||||
functionType.getAnnotations(),
|
||||
functionType.getConstructor(),
|
||||
functionType.isMarkedNullable(),
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ class PropagationHeuristics {
|
||||
|
||||
if (JetTypeChecker.DEFAULT.isSubtypeOf(elementType, elementTypeInSuper)
|
||||
&& !JetTypeChecker.DEFAULT.equalTypes(elementType, elementTypeInSuper)) {
|
||||
JetTypeImpl betterTypeInSuper = new JetTypeImpl(
|
||||
JetTypeImpl betterTypeInSuper = JetTypeImpl.create(
|
||||
arrayTypeFromSuper.getAnnotations(),
|
||||
arrayTypeFromSuper.getConstructor(),
|
||||
arrayTypeFromSuper.isMarkedNullable(),
|
||||
|
||||
+1
-1
@@ -407,7 +407,7 @@ public class SignaturesPropagationData {
|
||||
resultScope = autoType.getMemberScope();
|
||||
}
|
||||
|
||||
JetTypeImpl type = new JetTypeImpl(autoType.getAnnotations(),
|
||||
JetType type = JetTypeImpl.create(autoType.getAnnotations(),
|
||||
resultClassifier.getTypeConstructor(),
|
||||
resultNullable,
|
||||
resultArguments,
|
||||
|
||||
+1
-2
@@ -157,8 +157,7 @@ public class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
throw new AssertionError("Unexpected class of type constructor classifier "
|
||||
+ (typeConstructorClassifier == null ? "null" : typeConstructorClassifier.getClass().getName()));
|
||||
}
|
||||
return new JetTypeImpl(originalType.getAnnotations(), typeConstructor, false,
|
||||
altArguments, memberScope);
|
||||
return JetTypeImpl.create(originalType.getAnnotations(), typeConstructor, false, altArguments, memberScope);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user