Skip to content

Avoid type identity comparison in ASTHelpers.isSubtype - #6087

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_975749473
Sep 3, 2026
Merged

Avoid type identity comparison in ASTHelpers.isSubtype#6087
copybara-service[bot] merged 1 commit into
masterfrom
test_975749473

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Avoid type identity comparison in ASTHelpers.isSubtype

Check t.tsym == state.getSymtab().unknownSymbol instead of comparing t == state.getSymtab().unknownType by identity. UnknownType became an ErrorType
in JDK 24+ (JDK-8339296), but had TypeTag.UNKNOWN in earlier JDKs; comparing
tsym avoids type identity issues across JDK versions.

Check `t.tsym == state.getSymtab().unknownSymbol` instead of comparing `t ==
state.getSymtab().unknownType` by identity. `UnknownType` became an `ErrorType`
in JDK 24+ (JDK-8339296), but had `TypeTag.UNKNOWN` in earlier JDKs; comparing
`tsym` avoids type identity issues across JDK versions.

PiperOrigin-RevId: 975827572
@copybara-service
copybara-service Bot merged commit aa37745 into master Sep 3, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_975749473 branch September 3, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant