-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
@CompileTimeConstant
for enum fields.
The support for *class* fields was introduced in unknown commit. This CL merely extends it to enum fields, considering the similarity between them. There is also a feature request b/149290598 filed a few years back. Specifically, this CL aims to support the following use case (taken from b/149290598): ``` public class Example { public enum ExampleEnum { A("a"), B("b"); @CompileTimeConstant final String s; ExampleEnum(@CompileTimeConstant final String s) { this.s = s; } void invokeCtcMethod() { ctcMethod(s); } private void ctcMethod(@CompileTimeConstant String string) {} } } ``` PiperOrigin-RevId: 529230341
- Loading branch information
1 parent
c76f797
commit be4e826
Showing
3 changed files
with
75 additions
and
3 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
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