diff --git a/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt b/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt index 9917fefd105..76afe9f937a 100644 --- a/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt +++ b/compiler/util-klib/src/org/jetbrains/kotlin/library/UnresolvedLibrary.kt @@ -11,13 +11,21 @@ fun UnresolvedLibrary(path: String, libraryVersion: String?, lenient: Boolean): sealed class UnresolvedLibrary { abstract val path: String abstract val libraryVersion: String? + + @Deprecated(DEPRECATED_SUBSTITUTE_PATH, level = DeprecationLevel.ERROR) abstract fun substitutePath(newPath: String): UnresolvedLibrary + + companion object { + const val DEPRECATED_SUBSTITUTE_PATH = + "UnresolvedLibrary.substitutePath() is deprecated and is going to be removed in one of the future Kotlin releases" + } } data class RequiredUnresolvedLibrary( override val path: String, override val libraryVersion: String? ) : UnresolvedLibrary() { + @Deprecated(DEPRECATED_SUBSTITUTE_PATH, ReplaceWith("copy(path = newPath)"), level = DeprecationLevel.ERROR) override fun substitutePath(newPath: String): RequiredUnresolvedLibrary { return copy(path = newPath) } @@ -27,6 +35,7 @@ data class LenientUnresolvedLibrary( override val path: String, override val libraryVersion: String? ) : UnresolvedLibrary() { + @Deprecated(DEPRECATED_SUBSTITUTE_PATH, ReplaceWith("copy(path = newPath)"), level = DeprecationLevel.ERROR) override fun substitutePath(newPath: String): LenientUnresolvedLibrary { return copy(path = newPath) }