sdk
sdk copied to clipboard
Function tearoffs are not represented as FunctionReference in resolved AST
The dartdoc on FunctionReference has this example:
/// An expression representing a reference to a function, possibly with type
/// arguments applied to it, e.g. the expression `print` in `var x = print;`.
However, given a resolved AST for the following code:
void bar() {
}
void foo() {
final tearoff = bar;
}
bar in tearoff = bar is only a SimpleIdentifier and not a FunctionReference.
I'm not sure whether the docs are wrong, or the AST hasn't been updated where it should, but these seem to conflict.