-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't emit duplicate record component getters
Check if record component getters have been explicitly declared, and don't emit the synthetic methods if they have. bazelbuild/bazel#22105 PiperOrigin-RevId: 627802539
- Loading branch information
Showing
3 changed files
with
35 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
javatests/com/google/turbine/lower/testdata/record_getter_override.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== Foo.java === | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public record Foo(int bar, List<String> baz) { | ||
/** This should override the default baz() getter. */ | ||
public List<String> baz() { | ||
return baz == null ? new ArrayList<>() : baz; | ||
} | ||
} |