We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code should be strong-mode compliant:
class X {} UnmodifiableListView<X> a = new UnmodifiableListView<X>([]); Iterable<X> b = null; Iterable<X> c = (b ??= a);
but the analyzer actually produces the error:
#Unsound implicit cast from Object to Iterable<X> [STRONG_MODE_DOWN_CAST_COMPOSITE]
Note that this very similar (and functionally equivalent) code works fine:
class X {} List<X> a = new UnmodifiableListView<X>([]); Iterable<X> b = null; Iterable<X> c = (b ??= a);
so it seems it's specifically having trouble working out the common subtype of Iterable and UnmodifiableListView. Maybe mix-in related?
The text was updated successfully, but these errors were encountered:
I believe that this is an instance of this:
#25821
We are currently using the spec mode LUB, which is not very useful:
Sorry, something went wrong.
For discussion of spec mode LUB see:
#19282 #19425
Closing as duplicate of #25821 and #25802 , please re-open if you think something else is going on.
No branches or pull requests
The following code should be strong-mode compliant:
but the analyzer actually produces the error:
#Unsound implicit cast from Object to Iterable<X> [STRONG_MODE_DOWN_CAST_COMPOSITE]
Note that this very similar (and functionally equivalent) code works fine:
so it seems it's specifically having trouble working out the common subtype of Iterable and UnmodifiableListView. Maybe mix-in related?
The text was updated successfully, but these errors were encountered: