JVM: refactor JvmDefaultMode, remove/rename some entries
- remove ENABLE/COMPATIBILITY because they can no longer be used - remove forAllMethodsWithBody because its behavior is now equivalent to isEnabled - inline isCompatibility - inline DEFAULT - rename ALL_INCOMPATIBLE -> ALL
This commit is contained in:
committed by
Space Team
parent
6219806ab9
commit
28797a31b4
+1
-1
@@ -24,7 +24,7 @@ fun <D> FirBasedSymbol<out D>.isCompiledToJvmDefault(
|
||||
if (getAnnotationByClassId(JvmStandardClassIds.Annotations.JvmDefault, session) != null) return true
|
||||
|
||||
val container = getContainingClassSymbol(session)
|
||||
if (container !is FirRegularClassSymbol || container.origin.fromSource) return jvmDefaultMode.forAllMethodsWithBody
|
||||
if (container !is FirRegularClassSymbol || container.origin.fromSource) return jvmDefaultMode.isEnabled
|
||||
|
||||
// Opt-in is fine here because this flag is only possible for deserialized declarations, and it's set during deserialization.
|
||||
@OptIn(SymbolInternals::class)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ object FirJvmDefaultChecker : FirBasicDeclarationChecker(MppCheckerKind.Common)
|
||||
if (annotationWithCompatibility != null) {
|
||||
val source = annotationWithCompatibility.source
|
||||
when {
|
||||
jvmDefaultMode != JvmDefaultMode.ALL_INCOMPATIBLE -> {
|
||||
jvmDefaultMode != JvmDefaultMode.ALL -> {
|
||||
reporter.reportOn(source, FirJvmErrors.JVM_DEFAULT_WITH_COMPATIBILITY_IN_DECLARATION, context)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user