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

This reverts commit 5d80d895b6.

Reason for revert: The issue that broke the build the first time this was submitted has been fixed in ag/19125702. Also the errorprone build was added to presubmit for changes to these files so we should hopefully catch any other issues at presubmit now: cl/458501206

Change-Id: I80ca08df49c58a1ad70de917822301368d49fc67
This commit is contained in:
Cole Faust
2022-07-01 19:39:14 +00:00
parent 5d80d895b6
commit e5bf3fb4c2
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