Skip to content

Commit 4a31ad0

Browse files
committed
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
1 parent d1f2255 commit 4a31ad0

File tree

4 files changed

+8
-28
lines changed

4 files changed

+8
-28
lines changed

compiler/testData/builtin-classes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ public abstract class Number {
10841084
public abstract override /*1*/ /*fake_override*/ fun iterator(): kotlin.Iterator<N>
10851085
}
10861086

1087-
@kotlin.Deprecated(message = "Please use KProperty instead.", replaceWith = kotlin.ReplaceWith(expression = "KProperty<*>", imports = {"kotlin.reflect.KProperty"})) public interface PropertyMetadata {
1087+
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "Please use KProperty instead.", replaceWith = kotlin.ReplaceWith(expression = "KProperty<*>", imports = {"kotlin.reflect.KProperty"})) internal interface PropertyMetadata {
10881088
public abstract val name: kotlin.String
10891089
public abstract fun <get-name>(): kotlin.String
10901090
}

core/builtins/src/kotlin/PropertyMetadata.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616

1717
package kotlin
1818

19-
/**
20-
* Represents a property in a Kotlin class.
21-
*/
22-
@Deprecated("Please use KProperty instead.", ReplaceWith("KProperty<*>", "kotlin.reflect.KProperty"))
23-
public interface PropertyMetadata {
24-
/**
25-
* The name of the property.
26-
*/
27-
public val name: String
19+
@Deprecated("Please use KProperty instead.", ReplaceWith("KProperty<*>", "kotlin.reflect.KProperty"), DeprecationLevel.ERROR)
20+
internal interface PropertyMetadata {
21+
val name: String
2822
}

core/builtins/src/kotlin/reflect/KProperty.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
@file:Suppress("DEPRECATION_ERROR", "EXPOSED_SUPER_INTERFACE", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") // for PropertyMetadata inheritance
1718
package kotlin.reflect
1819

1920
/**

core/runtime.jvm/src/kotlin/PropertyMetadataImpl.kt

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
/*
18-
* Copyright 2010-2015 JetBrains s.r.o.
19-
*
20-
* Licensed under the Apache License, Version 2.0 (the "License");
21-
* you may not use this file except in compliance with the License.
22-
* You may obtain a copy of the License at
23-
*
24-
* http://www.apache.org/licenses/LICENSE-2.0
25-
*
26-
* Unless required by applicable law or agreed to in writing, software
27-
* distributed under the License is distributed on an "AS IS" BASIS,
28-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29-
* See the License for the specific language governing permissions and
30-
* limitations under the License.
31-
*/
32-
3317
package kotlin
3418

35-
@Deprecated("Please use KProperty instead.")
36-
data class PropertyMetadataImpl(override val name: String) : PropertyMetadata
19+
@Suppress("DEPRECATION_ERROR")
20+
@Deprecated("Please use KProperty instead.", level = DeprecationLevel.ERROR)
21+
internal data class PropertyMetadataImpl(override val name: String) : PropertyMetadata

0 commit comments

Comments
 (0)