The only primitives are numbers:
byteshortint,long,doublefloatand their unsigned alternatives...
Also, bool (simple layer over numbers), array and map.
There should also be classes,
| class String { | |
| final vec<byte> chars = new vec<>(); | |
| // Property | |
| long length { | |
| get() => chars.size(); | |
| // set(v) { ... } | |
| } | |
| // Shorthand | |
| long get length => chars.size(); | |
| } |
| class Todo { | |
| String text; | |
| bool completed; | |
| String foo { | |
| get() => 'foo: %text', | |
| set(v) { | |
| // Easy setter | |
| this.text = v; // `this` ref unnecessary | |
| }, | |
| set(v); // More shorthand | |
| } | |
| } | |
| class Bar extends Todo { | |
| String foo { | |
| @override | |
| get() => 'Override'; | |
| } | |
| } |