[Lombok K1] Fix name convention for @With on boolean fields
^KT-53370 Fixed
This commit is contained in:
+42
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user