[FIR] Make FirJvmStaticChecker more consistent with the legacy version
This commit is contained in:
+125
-113
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.descriptors.ClassKind
|
|||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||||
import org.jetbrains.kotlin.descriptors.Visibility
|
import org.jetbrains.kotlin.descriptors.Visibility
|
||||||
import org.jetbrains.kotlin.descriptors.isInterface
|
import org.jetbrains.kotlin.descriptors.isInterface
|
||||||
|
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||||
import org.jetbrains.kotlin.fir.analysis.checkers.classKind
|
import org.jetbrains.kotlin.fir.analysis.checkers.classKind
|
||||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||||
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker
|
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker
|
||||||
@@ -25,7 +26,7 @@ import org.jetbrains.kotlin.fir.symbols.SymbolInternals
|
|||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||||
import org.jetbrains.kotlin.name.ClassId
|
import org.jetbrains.kotlin.name.ClassId
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.SpecialNames
|
||||||
import org.jetbrains.kotlin.name.StandardClassIds
|
import org.jetbrains.kotlin.name.StandardClassIds
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||||
|
|
||||||
@@ -40,70 +41,121 @@ object FirJvmStaticChecker : FirBasicDeclarationChecker() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (declaration is FirPropertyAccessor) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val declarationAnnotation = declaration.findAnnotation(StandardClassIds.JvmStatic)
|
||||||
|
|
||||||
|
if (declarationAnnotation != null) {
|
||||||
|
checkAnnotated(declaration, context, reporter, declaration.source)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun checkIfAnnotated(it: FirAnnotatedDeclaration) {
|
||||||
|
if (!it.hasAnnotation(StandardClassIds.JvmStatic)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val targetSource = it.source ?: declaration.source
|
||||||
|
checkAnnotated(it, context, reporter, targetSource, declaration as? FirProperty)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (declaration is FirProperty) {
|
||||||
|
declaration.getter?.let { checkIfAnnotated(it) }
|
||||||
|
declaration.setter?.let { checkIfAnnotated(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkAnnotated(
|
||||||
|
declaration: FirAnnotatedDeclaration,
|
||||||
|
context: CheckerContext,
|
||||||
|
reporter: DiagnosticReporter,
|
||||||
|
targetSource: FirSourceElement?,
|
||||||
|
outerProperty: FirProperty? = null,
|
||||||
|
) {
|
||||||
if (declaration !is FirMemberDeclaration) {
|
if (declaration !is FirMemberDeclaration) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val annotatedParts = declaration.getAnnotatedParts()
|
val container = context.getContainerAt(0) ?: return
|
||||||
|
val supportsJvmStaticInInterface = context.supports(LanguageFeature.JvmStaticInInterface)
|
||||||
|
val containerIsAnonymous = container.classId.shortClassName == SpecialNames.ANONYMOUS
|
||||||
|
|
||||||
checkOverrideCannotBeStatic(declaration, context, reporter, annotatedParts)
|
if (
|
||||||
checkStaticNotInProperObject(context, reporter, annotatedParts)
|
container.classKind != ClassKind.OBJECT ||
|
||||||
checkStaticNonPublicOrExternal(declaration, context, reporter, annotatedParts)
|
!container.isCompanion() && containerIsAnonymous
|
||||||
checkStaticOnConstOrJvmField(context, reporter, annotatedParts)
|
) {
|
||||||
}
|
reportStaticNotInProperObject(context, reporter, supportsJvmStaticInInterface, targetSource)
|
||||||
|
} else if (
|
||||||
private fun checkStaticOnConstOrJvmField(
|
container.isCompanion() &&
|
||||||
context: CheckerContext,
|
context.containerIsInterface(1)
|
||||||
reporter: DiagnosticReporter,
|
) {
|
||||||
annotatedParts: List<FirAnnotatedDeclaration>,
|
if (supportsJvmStaticInInterface) {
|
||||||
) {
|
checkForInterface(declaration, context, reporter, targetSource)
|
||||||
annotatedParts.forEach {
|
} else {
|
||||||
if (
|
reportStaticNotInProperObject(context, reporter, supportsJvmStaticInInterface, targetSource)
|
||||||
it is FirProperty && it.isConst ||
|
|
||||||
it.hasAnnotationNamedAs(StandardClassIds.JvmField)
|
|
||||||
) {
|
|
||||||
reporter.reportOn(it.source, FirJvmErrors.JVM_STATIC_ON_CONST_OR_JVM_FIELD, context)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkOverrideCannotBeStatic(declaration, context, reporter, targetSource, outerProperty)
|
||||||
|
checkStaticOnConstOrJvmField(declaration, context, reporter, targetSource)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkStaticNonPublicOrExternal(
|
private fun reportStaticNotInProperObject(
|
||||||
declaration: FirMemberDeclaration,
|
|
||||||
context: CheckerContext,
|
context: CheckerContext,
|
||||||
reporter: DiagnosticReporter,
|
reporter: DiagnosticReporter,
|
||||||
annotatedParts: List<FirAnnotatedDeclaration>,
|
supportsJvmStaticInInterface: Boolean,
|
||||||
|
targetSource: FirSourceElement?,
|
||||||
) {
|
) {
|
||||||
val containingClassSymbol = context.getContainerAt(0) ?: return
|
val properDiagnostic = if (supportsJvmStaticInInterface) {
|
||||||
var shouldCheck = false
|
FirJvmErrors.JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION
|
||||||
|
|
||||||
if (containingClassSymbol.classKind != ClassKind.OBJECT) {
|
|
||||||
shouldCheck = true
|
|
||||||
} else {
|
} else {
|
||||||
if (context.containerIsInterface(1)) {
|
FirJvmErrors.JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION
|
||||||
shouldCheck = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!shouldCheck) {
|
reporter.reportOn(targetSource, properDiagnostic, context)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkForInterface(
|
||||||
|
declaration: FirAnnotatedDeclaration,
|
||||||
|
context: CheckerContext,
|
||||||
|
reporter: DiagnosticReporter,
|
||||||
|
targetSource: FirSourceElement?,
|
||||||
|
) {
|
||||||
|
if (declaration !is FirCallableDeclaration) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val minVisibility = declaration.getMinimumVisibility()
|
val visibility = if (declaration is FirProperty) {
|
||||||
|
declaration.getMinimumVisibility()
|
||||||
|
} else {
|
||||||
|
declaration.visibility
|
||||||
|
}
|
||||||
|
|
||||||
if (minVisibility != Visibilities.Public) {
|
val isExternal = if (declaration is FirProperty) {
|
||||||
annotatedParts.forEach {
|
declaration.hasExternalParts()
|
||||||
reporter.reportOn(it.source, FirJvmErrors.JVM_STATIC_ON_NON_PUBLIC_MEMBER, context)
|
} else {
|
||||||
}
|
declaration.isExternal
|
||||||
} else if (declaration.isExternal) {
|
}
|
||||||
annotatedParts.forEach {
|
|
||||||
reporter.reportOn(it.source, FirJvmErrors.JVM_STATIC_ON_EXTERNAL_IN_INTERFACE, context)
|
if (visibility != Visibilities.Public) {
|
||||||
}
|
reporter.reportOn(targetSource, FirJvmErrors.JVM_STATIC_ON_NON_PUBLIC_MEMBER, context)
|
||||||
|
} else if (isExternal) {
|
||||||
|
reporter.reportOn(targetSource, FirJvmErrors.JVM_STATIC_ON_EXTERNAL_IN_INTERFACE, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirMemberDeclaration.getMinimumVisibility() = when (this) {
|
private fun FirProperty.hasExternalParts(): Boolean {
|
||||||
is FirProperty -> getMinimumVisibility()
|
var hasExternal = isExternal
|
||||||
else -> this.visibility
|
|
||||||
|
getter?.let {
|
||||||
|
hasExternal = hasExternal || it.isExternal
|
||||||
|
}
|
||||||
|
|
||||||
|
setter?.let {
|
||||||
|
hasExternal = hasExternal || it.isExternal
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasExternal
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirProperty.getMinimumVisibility(): Visibility {
|
private fun FirProperty.getMinimumVisibility(): Visibility {
|
||||||
@@ -129,85 +181,36 @@ object FirJvmStaticChecker : FirBasicDeclarationChecker() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkStaticNotInProperObject(
|
|
||||||
context: CheckerContext,
|
|
||||||
reporter: DiagnosticReporter,
|
|
||||||
annotatedParts: List<FirAnnotatedDeclaration>,
|
|
||||||
) {
|
|
||||||
val containingClassSymbol = context.getContainerAt(0) ?: return
|
|
||||||
val supportJvmStaticInInterface = context.session.languageVersionSettings.supportsFeature(LanguageFeature.JvmStaticInInterface)
|
|
||||||
|
|
||||||
val properDiagnostic = if (supportJvmStaticInInterface) {
|
|
||||||
FirJvmErrors.JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION
|
|
||||||
} else {
|
|
||||||
FirJvmErrors.JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION
|
|
||||||
}
|
|
||||||
|
|
||||||
var shouldReport = false
|
|
||||||
|
|
||||||
if (containingClassSymbol.classKind != ClassKind.OBJECT) {
|
|
||||||
shouldReport = true
|
|
||||||
} else if (
|
|
||||||
containingClassSymbol is FirRegularClassSymbol &&
|
|
||||||
containingClassSymbol.isCompanion &&
|
|
||||||
context.containerIsInterface(1) &&
|
|
||||||
!supportJvmStaticInInterface
|
|
||||||
) {
|
|
||||||
shouldReport = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldReport) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
annotatedParts.forEach {
|
|
||||||
reporter.reportOn(it.source, properDiagnostic, context)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun checkOverrideCannotBeStatic(
|
private fun checkOverrideCannotBeStatic(
|
||||||
declaration: FirMemberDeclaration,
|
declaration: FirMemberDeclaration,
|
||||||
context: CheckerContext,
|
context: CheckerContext,
|
||||||
reporter: DiagnosticReporter,
|
reporter: DiagnosticReporter,
|
||||||
annotatedParts: List<FirAnnotatedDeclaration>,
|
targetSource: FirSourceElement?,
|
||||||
|
outerProperty: FirProperty? = null,
|
||||||
) {
|
) {
|
||||||
if (!declaration.isOverride || !context.containerIsNonCompanionObject(0)) {
|
val isOverride = outerProperty?.isOverride ?: declaration.isOverride
|
||||||
|
|
||||||
|
if (!isOverride || !context.containerIsNonCompanionObject(0)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
annotatedParts.forEach {
|
reporter.reportOn(targetSource, FirJvmErrors.OVERRIDE_CANNOT_BE_STATIC, context)
|
||||||
reporter.reportOn(it.source, FirJvmErrors.OVERRIDE_CANNOT_BE_STATIC, context)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirAnnotatedDeclaration.getAnnotatedParts(): List<FirAnnotatedDeclaration> {
|
private fun checkStaticOnConstOrJvmField(
|
||||||
return getReportableParts().filter {
|
declaration: FirAnnotatedDeclaration,
|
||||||
it.hasAnnotationNamedAs(StandardClassIds.JvmStatic)
|
context: CheckerContext,
|
||||||
|
reporter: DiagnosticReporter,
|
||||||
|
targetSource: FirSourceElement?,
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
declaration is FirProperty && declaration.isConst ||
|
||||||
|
declaration.hasAnnotationNamedAs(StandardClassIds.JvmField)
|
||||||
|
) {
|
||||||
|
reporter.reportOn(targetSource, FirJvmErrors.JVM_STATIC_ON_CONST_OR_JVM_FIELD, context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirAnnotatedDeclaration.getReportableParts(): List<FirAnnotatedDeclaration> {
|
|
||||||
val parts = mutableListOf(this)
|
|
||||||
|
|
||||||
if (this is FirProperty) {
|
|
||||||
fun takeIfNecessary(it: FirPropertyAccessor) {
|
|
||||||
if (it.visibility.compatibleAndLesser(this.visibility)) {
|
|
||||||
parts.add(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.getter?.let(::takeIfNecessary)
|
|
||||||
this.setter?.let(::takeIfNecessary)
|
|
||||||
}
|
|
||||||
|
|
||||||
return parts
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun Visibility.compatibleAndLesser(other: Visibility): Boolean {
|
|
||||||
val difference = this.compareTo(other) ?: return false
|
|
||||||
return difference <= 0
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun CheckerContext.containerIsInterface(outerLevel: Int): Boolean {
|
private fun CheckerContext.containerIsInterface(outerLevel: Int): Boolean {
|
||||||
return this.getContainerAt(outerLevel)?.classKind?.isInterface == true
|
return this.getContainerAt(outerLevel)?.classKind?.isInterface == true
|
||||||
}
|
}
|
||||||
@@ -222,7 +225,12 @@ object FirJvmStaticChecker : FirBasicDeclarationChecker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun CheckerContext.getContainerAt(outerLevel: Int): FirClassLikeSymbol<*>? {
|
private fun CheckerContext.getContainerAt(outerLevel: Int): FirClassLikeSymbol<*>? {
|
||||||
val last = this.containingDeclarations.asReversed().getOrNull(outerLevel)
|
val correction = if (this.containingDeclarations.lastOrNull() is FirProperty) {
|
||||||
|
1
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
val last = this.containingDeclarations.asReversed().getOrNull(outerLevel + correction)
|
||||||
return if (last is FirClassLikeDeclaration) {
|
return if (last is FirClassLikeDeclaration) {
|
||||||
last.symbol
|
last.symbol
|
||||||
} else {
|
} else {
|
||||||
@@ -230,13 +238,17 @@ object FirJvmStaticChecker : FirBasicDeclarationChecker() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun CheckerContext.supports(feature: LanguageFeature) = session.languageVersionSettings.supportsFeature(feature)
|
||||||
|
|
||||||
|
private fun FirClassLikeSymbol<*>.isCompanion() = safeAs<FirRegularClassSymbol>()?.isCompanion == true
|
||||||
|
|
||||||
private fun FirAnnotatedDeclaration.hasAnnotationNamedAs(classId: ClassId): Boolean {
|
private fun FirAnnotatedDeclaration.hasAnnotationNamedAs(classId: ClassId): Boolean {
|
||||||
return findAnnotation(classId.shortClassName) != null
|
return findAnnotation(classId) != null
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirAnnotatedDeclaration.findAnnotation(name: Name): FirAnnotationCall? {
|
private fun FirAnnotatedDeclaration.findAnnotation(classId: ClassId): FirAnnotationCall? {
|
||||||
return annotations.firstOrNull {
|
return annotations.firstOrNull {
|
||||||
it.calleeReference.safeAs<FirResolvedNamedReference>()?.name == name
|
it.calleeReference.safeAs<FirResolvedNamedReference>()?.name == classId.shortClassName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-53
@@ -1,53 +0,0 @@
|
|||||||
// !LANGUAGE: -JvmStaticInInterface
|
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
||||||
class A {
|
|
||||||
companion object {
|
|
||||||
@JvmStatic fun a1() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object A {
|
|
||||||
@JvmStatic fun a2() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val s = object {
|
|
||||||
@JvmStatic fun a3() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a4()<!> {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface B {
|
|
||||||
companion object {
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a1()<!> {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object A {
|
|
||||||
@JvmStatic fun a2() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val s = object {
|
|
||||||
@JvmStatic fun a3() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic fun a4()<!> {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: -JvmStaticInInterface
|
// !LANGUAGE: -JvmStaticInInterface
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
class A {
|
class A {
|
||||||
|
|||||||
-53
@@ -1,53 +0,0 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
|
||||||
// !LANGUAGE: +JvmStaticInInterface
|
|
||||||
class A {
|
|
||||||
companion object {
|
|
||||||
@JvmStatic fun a1() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object A {
|
|
||||||
@JvmStatic fun a2() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val s = object {
|
|
||||||
@JvmStatic fun a3() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic fun a4()<!> {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface B {
|
|
||||||
companion object {
|
|
||||||
@JvmStatic fun a1() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object A {
|
|
||||||
@JvmStatic fun a2() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
val s = object {
|
|
||||||
@JvmStatic fun a3() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic fun a4()<!> {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// !LANGUAGE: +JvmStaticInInterface
|
// !LANGUAGE: +JvmStaticInInterface
|
||||||
class A {
|
class A {
|
||||||
|
|||||||
Vendored
+11
-11
@@ -6,38 +6,38 @@ interface B {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private fun a2()<!> {
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic private fun a2()<!> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic protected fun a3()<!> {
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic protected fun a3()<!> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic internal fun a4()<!> {
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic internal fun a4()<!> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_EXTERNAL_IN_INTERFACE!>@JvmStatic external fun a5()<!>
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic external fun a5()<!>
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
var foo<!> = 1
|
var foo<!> = 1
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
var foo1<!> = 1
|
var foo1<!> = 1
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
var foo2<!> = 1
|
var foo2<!> = 1
|
||||||
private set
|
private set
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
private var foo3<!> = 1
|
private var foo3<!> = 1
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
protected var foo4<!> = 1
|
protected var foo4<!> = 1
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
protected var foo5<!> = 1
|
protected var foo5<!> = 1
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
@@ -47,10 +47,10 @@ interface B {
|
|||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic get<!>
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic get<!>
|
||||||
|
|
||||||
private var foo8 = 1
|
private var foo8 = 1
|
||||||
@JvmStatic <!SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>public<!> set
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic <!SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>public<!> set<!>
|
||||||
|
|
||||||
public var foo9 = 1
|
public var foo9 = 1
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic private set<!>
|
||||||
|
|
||||||
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic
|
||||||
val foo10: Int<!> external get
|
val foo10: Int<!> external get
|
||||||
|
|||||||
+3
-3
@@ -54,10 +54,10 @@ interface B {
|
|||||||
public var foo9 = 1
|
public var foo9 = 1
|
||||||
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
|
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
|
||||||
|
|
||||||
@JvmStatic
|
<!JVM_STATIC_ON_EXTERNAL_IN_INTERFACE!>@JvmStatic
|
||||||
val foo10: Int external get
|
val foo10: Int<!> external get
|
||||||
|
|
||||||
val foo11: Int @JvmStatic external get
|
val foo11: Int <!JVM_STATIC_ON_EXTERNAL_IN_INTERFACE!>@JvmStatic external get<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -53,10 +53,10 @@ interface B {
|
|||||||
public var foo9 = 1
|
public var foo9 = 1
|
||||||
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
|
<!JVM_STATIC_ON_NON_PUBLIC_MEMBER!>@JvmStatic private set<!>
|
||||||
|
|
||||||
@JvmStatic
|
<!JVM_STATIC_ON_EXTERNAL_IN_INTERFACE!>@JvmStatic
|
||||||
val foo10: Int external get
|
val foo10: Int<!> external get
|
||||||
|
|
||||||
val foo11: Int @JvmStatic external get
|
val foo11: Int <!JVM_STATIC_ON_EXTERNAL_IN_INTERFACE!>@JvmStatic external get<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user