-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
This issue was originally filed by @filiph
What steps will reproduce the problem?
- Extend a class that has an optional parameter in the constructor.
- Add a mixin
What is the expected output? What do you see instead?
I get a runtime error:
forwarding constructors must not have optional parameters
I would expect this to work without problems, or at least to have better explanation (it is, for example, not clear if the culprit is the base class, the mixin, or the class being extended) and a compile time error.
But really, I find this quite limiting.
What version of the product are you using? On what operating system?
Dart Editor version 1.0.0_r30187 (DEV)
Dart SDK version 1.0.0.3_r30187
Mac OSX 10.8.5
Please provide any additional information below.
===== CODE =====
class Mixin extends Object {
int mixinMember;
}
class BaseClass {
int baseMember;
BaseClass({this.baseMember: -1});
}
class Class extends BaseClass with Mixin {
int member;
Class(this.member);
}
void main() {
var c = new Class(42);
}
===== /CODE =====
Attachment:
mixinoptparameters.dart (249 Bytes)