Update git submodules
* Update platform/tools/metalava from branch 'master'
to c0bc120695b767aa6e96a2d5d354f2d6e411fea1
- Use TypeItem for TypeParameterBounds
This CL changes TypeParameterItem's bounds type to TypeItem from
ClassItem. Technically, type bounds are not classes, they are "type
references" which seems to be mostly represented as types in metalava.
Due to downstream branches, I had to use a new name (typeBounds) and
deprecated the old bounds() function.
I also noticed that ApiLint was doing a primitive bounds check relying
on these being classes. I wrote an alternative implementation when PSI
is present to use type assignability instead. For text based types, it
is harder to implement assignability so I left the code there as
fallback for text based types.
This change also found a false negative in Compatibility check tests
where it was asserting an error due to a type parameter name change even
though the types are still equal.
CompatibilityChecker still uses class to check for bounds right now.
I've not changed it since one of the TypeItem's there is text based,
hence implementing extends is tricky there :(
Finally, TextTypeParameterItems's bounds method was dropping type
arguments, which broke platform build (it was OK when these were classes
since classes don't have arguments, only parameter types). I tried to
properly fix it but it was getting too complicated so I rather patched
the bounds method to include the type arguments. Added a test to
validate.
Bug: 221963837
Test: PsiTypeItemAssignabilityTest, CompatibilityCheckTest
Change-Id: I28e9e53da9ef5c3d038baeaaf2cdcb8a26f6ab9c
Loading
Please sign in to comment