Skip to content

Commit d1456ca

Browse files
sandwwraithSpace Team
authored andcommitted
[FIR/ReturnValueChecker] Split string literal with errorprone package name.
To avoid its relocation during kotlin-compiler-embeddable shadowing. #KT-79662 Fixed #KTI-2545
1 parent 38b7beb commit d1456ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/fir/semantics/src/org/jetbrains/kotlin/fir/declarations/FirMustUseReturnValueStatusComponent.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ abstract class FirMustUseReturnValueStatusComponent : FirSessionComponent {
3939
javaPackageAnnotations: List<ClassId>? = null,
4040
): Boolean
4141

42+
// FIXME (KTI-2545): One can't simply write errorprone package name, because whole com.google. package is relocated in kotlin-compiler-embeddable.
43+
// For the time being, string literal should be split.
44+
internal val errorPronePackageFqName: FqName = FqName.fromSegments(listOf("com", "google", "errorprone", "annotations"))
45+
4246
private val ignorableReturnValueLikeAnnotations: Set<ClassId> = setOf(
4347
StandardClassIds.Annotations.IgnorableReturnValue,
44-
ClassId(FqName("com.google.errorprone.annotations"), Name.identifier("CanIgnoreReturnValue")),
48+
ClassId(errorPronePackageFqName, Name.identifier("CanIgnoreReturnValue")),
4549
// Apparently, org.jetbrains.annotations and org.springframework.lang do not have CanIgnoreReturnValue because they have slightly different design
4650
)
4751

@@ -79,7 +83,7 @@ abstract class FirMustUseReturnValueStatusComponent : FirSessionComponent {
7983
private class Default : FirMustUseReturnValueStatusComponent() {
8084
private val mustUseReturnValueLikeAnnotations: Set<ClassId> = setOf(
8185
StandardClassIds.Annotations.MustUseReturnValue,
82-
ClassId(FqName("com.google.errorprone.annotations"), Name.identifier("CheckReturnValue")),
86+
ClassId(errorPronePackageFqName, Name.identifier("CheckReturnValue")),
8387
ClassId(FqName("org.jetbrains.annotations"), Name.identifier("CheckReturnValue")),
8488
ClassId(FqName("org.springframework.lang"), Name.identifier("CheckReturnValue")),
8589
)

0 commit comments

Comments
 (0)