error with redirecting constructors + optional args + mixins #19226
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
This program behaves differently if you run it in the VM or with dart2js:
class A {}
class B extends A {
B([x]);
}
class C extends B with A {
C() : super(0);
}
main() => print(new C());
The VM fails with this error:
'file:///home/sigmund/playground/dart_tests/fwderror.dart': error: line 7 pos 24: forwarding constructors must not have optional parameters
class C extends B with A {
^
And dart2js successfully compiles and runs it. I believe the dart2js behavior is the correct one in this case.
The text was updated successfully, but these errors were encountered: