Minor. Reformat
This commit is contained in:
+18
-17
@@ -42,16 +42,15 @@ class InlinePlatformCompatibilityChecker(val jvmTarget: JvmTarget) : CallChecker
|
|||||||
val resultingDescriptor = resolvedCall.resultingDescriptor as? CallableMemberDescriptor ?: return
|
val resultingDescriptor = resolvedCall.resultingDescriptor as? CallableMemberDescriptor ?: return
|
||||||
if (!InlineUtil.isInline(resultingDescriptor)) {
|
if (!InlineUtil.isInline(resultingDescriptor)) {
|
||||||
if (resultingDescriptor is PropertyDescriptor && InlineUtil.isInline(resultingDescriptor.getter)) {
|
if (resultingDescriptor is PropertyDescriptor && InlineUtil.isInline(resultingDescriptor.getter)) {
|
||||||
//TODO: we should distinguish setter usage from getter one, now we could report wrong diagnostic on non-inline setter
|
//TODO: we should distinguish setter usage from getter one, now we could report wrong diagnostic on non-inline setter
|
||||||
//var prop: Int
|
//var prop: Int
|
||||||
// inline get
|
// inline get
|
||||||
// set
|
// set
|
||||||
//
|
//
|
||||||
// prop - resolved call with property descriptor and we should report error
|
// prop - resolved call with property descriptor and we should report error
|
||||||
// prop = 1 - resolved call with setter for whole expression and property descriptor for left part,
|
// prop = 1 - resolved call with setter for whole expression and property descriptor for left part,
|
||||||
// so we couldn't distinguish is this expression for setter or for getter and will report wrong diagnostic
|
// so we couldn't distinguish is this expression for setter or for getter and will report wrong diagnostic
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,11 +60,13 @@ class InlinePlatformCompatibilityChecker(val jvmTarget: JvmTarget) : CallChecker
|
|||||||
|
|
||||||
val compilingBytecodeVersion = jvmTarget.bytecodeVersion
|
val compilingBytecodeVersion = jvmTarget.bytecodeVersion
|
||||||
if (compilingBytecodeVersion < inliningBytecodeVersion) {
|
if (compilingBytecodeVersion < inliningBytecodeVersion) {
|
||||||
context.trace.report(ErrorsJvm.INLINE_FROM_HIGHER_PLATFORM.on(
|
context.trace.report(
|
||||||
|
ErrorsJvm.INLINE_FROM_HIGHER_PLATFORM.on(
|
||||||
reportOn,
|
reportOn,
|
||||||
JvmTarget.getDescription(inliningBytecodeVersion),
|
JvmTarget.getDescription(inliningBytecodeVersion),
|
||||||
JvmTarget.getDescription(compilingBytecodeVersion)
|
JvmTarget.getDescription(compilingBytecodeVersion)
|
||||||
))
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,11 +80,11 @@ class InlinePlatformCompatibilityChecker(val jvmTarget: JvmTarget) : CallChecker
|
|||||||
|
|
||||||
val source = containingDeclaration.source
|
val source = containingDeclaration.source
|
||||||
val binaryClass =
|
val binaryClass =
|
||||||
when (source) {
|
when (source) {
|
||||||
is KotlinJvmBinarySourceElement -> source.binaryClass
|
is KotlinJvmBinarySourceElement -> source.binaryClass
|
||||||
is KotlinJvmBinaryPackageSourceElement -> source.getContainingBinaryClass(funOrProperty)
|
is KotlinJvmBinaryPackageSourceElement -> source.getContainingBinaryClass(funOrProperty)
|
||||||
else -> null
|
else -> null
|
||||||
} as? FileBasedKotlinClass ?: return null
|
} as? FileBasedKotlinClass ?: return null
|
||||||
|
|
||||||
return binaryClass.classVersion
|
return binaryClass.classVersion
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user