Minor. [platformStatic] used
This commit is contained in:
@@ -96,7 +96,7 @@ public class CommonSupertypes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!hasFlexible) return commonSuperTypeForInflexible(types, recursionDepth, maxDepth);
|
if (!hasFlexible) return commonSuperTypeForInflexible(types, recursionDepth, maxDepth);
|
||||||
return DelegatingFlexibleType.OBJECT$.create(
|
return DelegatingFlexibleType.create(
|
||||||
commonSuperTypeForInflexible(lower, recursionDepth, maxDepth),
|
commonSuperTypeForInflexible(lower, recursionDepth, maxDepth),
|
||||||
commonSuperTypeForInflexible(upper, recursionDepth, maxDepth),
|
commonSuperTypeForInflexible(upper, recursionDepth, maxDepth),
|
||||||
KotlinPackage.single(capabilities) // mixing different capabilities is not supported
|
KotlinPackage.single(capabilities) // mixing different capabilities is not supported
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class TypeSubstitutor {
|
|||||||
unsafeSubstitute(new TypeProjectionImpl(originalProjectionKind, flexibility.getUpperBound()), recursionDepth + 1);
|
unsafeSubstitute(new TypeProjectionImpl(originalProjectionKind, flexibility.getUpperBound()), recursionDepth + 1);
|
||||||
// todo: projection kind is neglected
|
// todo: projection kind is neglected
|
||||||
return new TypeProjectionImpl(originalProjectionKind,
|
return new TypeProjectionImpl(originalProjectionKind,
|
||||||
DelegatingFlexibleType.OBJECT$.create(
|
DelegatingFlexibleType.create(
|
||||||
substitutedLower.getType(),
|
substitutedLower.getType(),
|
||||||
substitutedUpper.getType(),
|
substitutedUpper.getType(),
|
||||||
flexibility.getExtraCapabilities()
|
flexibility.getExtraCapabilities()
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.jetbrains.jet.lang.types
|
|||||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker
|
import org.jetbrains.jet.lang.types.checker.JetTypeChecker
|
||||||
import org.jetbrains.jet.lang.types.Approximation.DataFlowExtras
|
import org.jetbrains.jet.lang.types.Approximation.DataFlowExtras
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName
|
import org.jetbrains.jet.lang.resolve.name.FqName
|
||||||
|
import kotlin.platform.platformStatic
|
||||||
|
|
||||||
public trait FlexibleTypeCapabilities {
|
public trait FlexibleTypeCapabilities {
|
||||||
fun <T: TypeCapability> getCapability(capabilityClass: Class<T>, jetType: JetType, flexibility: Flexibility): T?
|
fun <T: TypeCapability> getCapability(capabilityClass: Class<T>, jetType: JetType, flexibility: Flexibility): T?
|
||||||
@@ -119,7 +120,7 @@ public open class DelegatingFlexibleType protected (
|
|||||||
override val extraCapabilities: FlexibleTypeCapabilities
|
override val extraCapabilities: FlexibleTypeCapabilities
|
||||||
) : DelegatingType(), NullAwareness, Flexibility, Approximation {
|
) : DelegatingType(), NullAwareness, Flexibility, Approximation {
|
||||||
class object {
|
class object {
|
||||||
fun create(lowerBound: JetType, upperBound: JetType, extraCapabilities: FlexibleTypeCapabilities): JetType {
|
platformStatic fun create(lowerBound: JetType, upperBound: JetType, extraCapabilities: FlexibleTypeCapabilities): JetType {
|
||||||
if (lowerBound == upperBound) return lowerBound
|
if (lowerBound == upperBound) return lowerBound
|
||||||
return DelegatingFlexibleType(lowerBound, upperBound, extraCapabilities)
|
return DelegatingFlexibleType(lowerBound, upperBound, extraCapabilities)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -106,7 +106,7 @@ public class TypeDeserializer {
|
|||||||
|
|
||||||
if (capabilities == null) return ErrorUtils.createErrorType(new DeserializedType(proto) + ": Capabilities not found for id " + id);
|
if (capabilities == null) return ErrorUtils.createErrorType(new DeserializedType(proto) + ": Capabilities not found for id " + id);
|
||||||
|
|
||||||
return DelegatingFlexibleType.OBJECT$.create(
|
return DelegatingFlexibleType.create(
|
||||||
new DeserializedType(proto),
|
new DeserializedType(proto),
|
||||||
new DeserializedType(proto.getFlexibleUpperBound()),
|
new DeserializedType(proto.getFlexibleUpperBound()),
|
||||||
capabilities
|
capabilities
|
||||||
|
|||||||
Reference in New Issue
Block a user