From 4a31ad0d5373e18c3fb1f0b527b8c803f47f0de4 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 13 Jan 2016 16:03:03 +0300 Subject: [PATCH] Make PropertyMetadata internal and deprecated with error To make them inaccessible from Kotlin sources and drop them later. They're still needed in runtime because Kotlin tests run old IDEA code (which depends on PropertyMetadata) with our own runtime --- compiler/testData/builtin-classes.txt | 2 +- core/builtins/src/kotlin/PropertyMetadata.kt | 12 +++-------- core/builtins/src/kotlin/reflect/KProperty.kt | 1 + .../src/kotlin/PropertyMetadataImpl.kt | 21 +++---------------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index c1981d7b74c..f00d52e93d9 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1084,7 +1084,7 @@ public abstract class Number { public abstract override /*1*/ /*fake_override*/ fun iterator(): kotlin.Iterator } -@kotlin.Deprecated(message = "Please use KProperty instead.", replaceWith = kotlin.ReplaceWith(expression = "KProperty<*>", imports = {"kotlin.reflect.KProperty"})) public interface PropertyMetadata { +@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Please use KProperty instead.", replaceWith = kotlin.ReplaceWith(expression = "KProperty<*>", imports = {"kotlin.reflect.KProperty"})) internal interface PropertyMetadata { public abstract val name: kotlin.String public abstract fun (): kotlin.String } diff --git a/core/builtins/src/kotlin/PropertyMetadata.kt b/core/builtins/src/kotlin/PropertyMetadata.kt index 42375cf1d2d..95a8b1997e2 100644 --- a/core/builtins/src/kotlin/PropertyMetadata.kt +++ b/core/builtins/src/kotlin/PropertyMetadata.kt @@ -16,13 +16,7 @@ package kotlin -/** - * Represents a property in a Kotlin class. - */ -@Deprecated("Please use KProperty instead.", ReplaceWith("KProperty<*>", "kotlin.reflect.KProperty")) -public interface PropertyMetadata { - /** - * The name of the property. - */ - public val name: String +@Deprecated("Please use KProperty instead.", ReplaceWith("KProperty<*>", "kotlin.reflect.KProperty"), DeprecationLevel.ERROR) +internal interface PropertyMetadata { + val name: String } diff --git a/core/builtins/src/kotlin/reflect/KProperty.kt b/core/builtins/src/kotlin/reflect/KProperty.kt index 481b0596f71..6b22e6c8746 100644 --- a/core/builtins/src/kotlin/reflect/KProperty.kt +++ b/core/builtins/src/kotlin/reflect/KProperty.kt @@ -14,6 +14,7 @@ * limitations under the License. */ +@file:Suppress("DEPRECATION_ERROR", "EXPOSED_SUPER_INTERFACE", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") // for PropertyMetadata inheritance package kotlin.reflect /** diff --git a/core/runtime.jvm/src/kotlin/PropertyMetadataImpl.kt b/core/runtime.jvm/src/kotlin/PropertyMetadataImpl.kt index fef5173a511..bd5774c5569 100644 --- a/core/runtime.jvm/src/kotlin/PropertyMetadataImpl.kt +++ b/core/runtime.jvm/src/kotlin/PropertyMetadataImpl.kt @@ -14,23 +14,8 @@ * limitations under the License. */ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package kotlin -@Deprecated("Please use KProperty instead.") -data class PropertyMetadataImpl(override val name: String) : PropertyMetadata +@Suppress("DEPRECATION_ERROR") +@Deprecated("Please use KProperty instead.", level = DeprecationLevel.ERROR) +internal data class PropertyMetadataImpl(override val name: String) : PropertyMetadata