Merge "Revert^2 "Fix erroneous "Field requires API level 33 (current min is 32)" warnings""

This commit is contained in:
Cole Faust
2022-07-01 22:48:49 +00:00
committed by Gerrit Code Review
3 changed files with 38 additions and 10 deletions

View File

@@ -54,6 +54,14 @@ type ApiLevel struct {
isPreview bool
}
func (this ApiLevel) FinalInt() int {
if this.IsPreview() {
panic("Requested a final int from a non-final ApiLevel")
} else {
return this.number
}
}
func (this ApiLevel) FinalOrFutureInt() int {
if this.IsPreview() {
return FutureApiLevelInt