[Lombok K1] Fix name convention for @With on boolean fields

^KT-53370 Fixed
This commit is contained in:
Dmitriy Novozhilov
2022-08-03 13:37:28 +03:00
parent 166965e559
commit 637d7678b8
5 changed files with 69 additions and 1 deletions
+42
View File
@@ -0,0 +1,42 @@
// IGNORE_BACKEND_FIR: JVM_IR
// ISSUE: KT-53451, KT-53370
// FILE: UserData.java
import lombok.*;
public class UserData {
@With @Getter
private final String name;
@With @Getter
private final boolean isSome;
@With @Getter
private final boolean hasFlag;
@With @Getter
private final boolean justAnother;
public UserData(String name, boolean isSome, boolean hasFlag, boolean justAnother) {
this.name = name;
this.isSome = isSome;
this.hasFlag = hasFlag;
this.justAnother = justAnother;
}
}
// FILE: main.kt
fun box(): String {
val user = UserData("Bob", false, false, false)
val modifiedUser = user
.withName("Alex")
.withSome(true)
.withHasFlag(true)
.withJustAnother(true)
return if (modifiedUser.name == "Alex" && modifiedUser.isSome && modifiedUser.isHasFlag && modifiedUser.isJustAnother) {
"OK"
} else {
"Error"
}
}