Closed
Description
This issue was originally filed by [email protected]
Code:
class C {
C() : v = this.f {}
var v;
final f = 1;
}
The compile-time error I see on VM is:
unexpected use of 'this' in primary expression
C() : v = this.f {}
^
According to spec, the initializer requires a conditionalExpression argument, which can be reduced to a postfixExpression of the form primary.identifier and this.f perfectly matches this production.
When an unqualified invocation/field access is used, the error is about illegal access to 'this', and it should probably be the same error in this case.