From a6a9caa3cd23213e99807042bc62196eb3e57ed1 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Fri, 22 Apr 2016 19:58:40 +0300 Subject: [PATCH] Minor. Remove Dynamicity. --- .../src/org/jetbrains/kotlin/types/dynamicTypes.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/dynamicTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/types/dynamicTypes.kt index d72bdcb3f6e..ebdb48bf256 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/dynamicTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/dynamicTypes.kt @@ -31,9 +31,7 @@ class DynamicTypesAllowed: DynamicTypesSettings() { get() = true } -interface Dynamicity : TypeCapability - -fun KotlinType.isDynamic(): Boolean = this.getCapability(Dynamicity::class.java) != null +fun KotlinType.isDynamic(): Boolean = this.getCapability(Flexibility::class.java)?.factory == DynamicTypeFactory fun createDynamicType(builtIns: KotlinBuiltIns) = DynamicTypeFactory.create(builtIns.nothingType, builtIns.nullableAnyType) @@ -51,14 +49,7 @@ object DynamicTypeFactory : FlexibleTypeFactory { } private class Impl(lowerBound: KotlinType, upperBound: KotlinType) : - DelegatingFlexibleType(lowerBound, upperBound, DynamicTypeFactory), Dynamicity { - - override fun getCapability(capabilityClass: Class): T? { - @Suppress("UNCHECKED_CAST") - if (capabilityClass == Dynamicity::class.java) return this as T - - return super.getCapability(capabilityClass) - } + DelegatingFlexibleType(lowerBound, upperBound, DynamicTypeFactory) { override val delegateType: KotlinType get() = upperBound