Fix 1.0-compatibility mode for JDK dependendent built-ins
Do not report UNSUPPORTED_FEATURE if there is no overridden descriptors E.g. in case of property accessors
This commit is contained in:
+2
-1
@@ -56,7 +56,8 @@ object AdditionalBuiltInsMemberOverrideDeclarationChecker : DeclarationChecker {
|
||||
val resultingDescriptor = descriptor as? CallableMemberDescriptor ?: return
|
||||
val overrideKeyword = declaration.modifierList?.getModifier(KtTokens.OVERRIDE_KEYWORD) ?: return
|
||||
|
||||
if (resultingDescriptor.original.overriddenDescriptors.all { it.isAdditionalBuiltInMember() }) {
|
||||
val overriddenDescriptors = resultingDescriptor.original.overriddenDescriptors
|
||||
if (overriddenDescriptors.isNotEmpty() && overriddenDescriptors.all { it.isAdditionalBuiltInMember() }) {
|
||||
diagnosticHolder.report(Errors.UNSUPPORTED_FEATURE.on(overrideKeyword, LanguageFeature.AdditionalBuiltInsMembers))
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -29,3 +29,14 @@ fun foo(x: List<String>, y: Throwable) {
|
||||
// Falls back to extension in stdlib
|
||||
y.printStackTrace()
|
||||
}
|
||||
|
||||
interface X {
|
||||
fun foo(): Int = 1
|
||||
val hidden: Boolean
|
||||
}
|
||||
|
||||
class Y : X {
|
||||
// There should not be UNSUPPORTED_FEATURE diagnostic
|
||||
override fun foo() = 1
|
||||
override var hidden: Boolean = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user