-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Closed
Milestone
Description
- Only allow assignments to fields in constructor and translate these assignment into constructor initializers
- Make field declaration explicit through
@FIELD
annotation - Make
const constructor
s in Dart through@CONST
annotation
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