Open
Description
class A {
B() : super();
}
library;
import self as self;
import "dart:core" as core;
class A extends core::Object {
default constructor •() → void
: super core::Object::•()
;
abstract method B() → dynamic;
}
static const field dynamic #errors = const <dynamic>["file:///test.dart:2:16: Error: Can't have initializers: B\n B() : super();\n ^"]/* from null */;
There is inconsistency between Analyzer parser and Fasta.
Analyzer reports an error and treats B() : super()
as A() : super()
because there is :
after parameters.
Fasta says that this is a method, and it should not have constructor initializers.
I think Analyzer's behavior is a bit better because we lose less nodes when we recover this way.