sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Function tearoffs are not represented as FunctionReference in resolved AST

Open DanTup opened this issue 3 years ago • 4 comments

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.

DanTup avatar Jul 11 '22 15:07 DanTup