New issue
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
Inlining issue because @:coreApi is annoying #7379
Comments
Surprisingly, this isn't a regression. But it's pretty dumb... |
covariance is fine, but requires proper docgen handling so it doesn't generate different method signatures |
Yes docgen is also my main concern here... |
Supporting covariance here is not an easy change. We currently use |
Not a regression and very tricky, pushing back. |
This generates:
The reason for that is obvious in the dump file:
The underlying problem here is that
StringMap.iterator
is typed to beIterator<T>
, which means thenext
/hasNext
field accesses are made on the structure and are not inlined.From the inliner's point of view, this is the correct behavior. We don't want to lose the return type of an inline function, so casting to
Iterator<Int>
is only consistent.I think
@:coreApi
should allow covariance for return types so thatStringMap.iterator
can be typed to returnStringMapIterator<T>
instead ofIterator<T>
.The text was updated successfully, but these errors were encountered: