-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Milestone
Description
- Only allow assignments to fields in constructor and translate these assignment into constructor initializers
- Make field declaration explicit through
@FIELDannotation - Make
const constructors in Dart through@CONSTannotation
Example:
class Annotation {
@FIELD('final name:String')
@FIELD('final age:int')
@CONST constructor(name:String, age:int) {
this.name = 'Hello ' + name;
this.age = age + 0;
}
}
@Annotation('usage', 5)
class Foo {}
this needs to transpile to:
class Annotation {
final String name;
final int age;
const Annotation(String name, int age):
name = 'Hello ' + name,
age = age + 0;
}
@Annotation('usage', 5)
class Foo {}
Metadata
Metadata
Assignees
Labels
No labels