Do not load PlatformDependent annotated built-in members with lv=1.0

#KT-15780 Fixed
This commit is contained in:
Denis Zharkov
2017-01-17 17:47:27 +03:00
parent 591de36666
commit 22ddfed911
2 changed files with 4 additions and 0 deletions
@@ -20,6 +20,8 @@ fun foo(x: List<String>, y: Throwable) {
y.fillInStackTrace() checkType { _<Int>() }
HashMap<String, Int>().getOrDefault(Any(), null)
// Falls back to extension in stdlib
y.printStackTrace()
}
@@ -333,6 +333,8 @@ open class JvmBuiltInsSettings(
override fun isFunctionAvailable(classDescriptor: DeserializedClassDescriptor, functionDescriptor: SimpleFunctionDescriptor): Boolean {
if (!functionDescriptor.annotations.hasAnnotation(PLATFORM_DEPENDENT_ANNOTATION_FQ_NAME)) return true
if (!isAdditionalBuiltInsFeatureSupported) return false
val javaAnalogueClassDescriptor = classDescriptor.getJavaAnalogue() ?: return true
val jvmDescriptor = functionDescriptor.computeJvmDescriptor()