Consider adding a static type of the receiver into the AST nodes for invocations #46340
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
P3
A lower priority bug or feature request
functionType
in the new invocation nodes such asInstanceInvocation
doesn't include static type of the receiver.VM uses static type of the receiver to do certain optimizations and stores it in the call site attributes metadata.
It would be much more convenient to include that information in the invocation nodes. Other back-ends might also benefit from having that information.
Example:
Kernel:
VM uses static type of the receiver (
B<String>
) in the first case to speculatively skip parameter type check if actual type at runtime matches static type. It also uses the fact that static type of the receiver (C
) is non-generic in the 2nd case to skip type check.@johnniwinther @mkustermann @mraleph
The text was updated successfully, but these errors were encountered: