Minor. [platformStatic] used

This commit is contained in:
Andrey Breslav
2014-10-12 23:23:56 +04:00
parent f1675a9162
commit f7ccfafd1c
4 changed files with 5 additions and 4 deletions
@@ -96,7 +96,7 @@ public class CommonSupertypes {
}
if (!hasFlexible) return commonSuperTypeForInflexible(types, recursionDepth, maxDepth);
return DelegatingFlexibleType.OBJECT$.create(
return DelegatingFlexibleType.create(
commonSuperTypeForInflexible(lower, recursionDepth, maxDepth),
commonSuperTypeForInflexible(upper, recursionDepth, maxDepth),
KotlinPackage.single(capabilities) // mixing different capabilities is not supported
@@ -163,7 +163,7 @@ public class TypeSubstitutor {
unsafeSubstitute(new TypeProjectionImpl(originalProjectionKind, flexibility.getUpperBound()), recursionDepth + 1);
// todo: projection kind is neglected
return new TypeProjectionImpl(originalProjectionKind,
DelegatingFlexibleType.OBJECT$.create(
DelegatingFlexibleType.create(
substitutedLower.getType(),
substitutedUpper.getType(),
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.Approximation.DataFlowExtras
import org.jetbrains.jet.lang.resolve.name.FqName
import kotlin.platform.platformStatic
public trait FlexibleTypeCapabilities {
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
) : DelegatingType(), NullAwareness, Flexibility, Approximation {
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
return DelegatingFlexibleType(lowerBound, upperBound, extraCapabilities)
}
@@ -106,7 +106,7 @@ public class TypeDeserializer {
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.getFlexibleUpperBound()),
capabilities