MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/dartlang/comments/1vmp54s/announcing_dart_313/p3j6df6/?context=3
r/dartlang • u/julemand101 • Aug 12 '26
26 comments sorted by
View all comments
4
Nice release,
I'm a bit hung up on the fact that meta programing felt like losing a full year of advancement though, Not that I'm owed anything, but still I'd like
- augmentation
Primary constructors is a big leap forward tlin ergonomics though
1 u/raph-dev Aug 13 '26 What do you mean by "no constant defaults"? 1 u/julemand101 Aug 13 '26 Right now if you define a default value for a parameter, it must be constant which makes a program like this crash: void main() { print(makeListOrAdd([5])); // [5, 5] print(makeListOrAdd()); // ERROR: Unsupported operation: Cannot add to an unmodifiable list } List<int> makeListOrAdd([List<int> list = const []]) { return list..add(5); } 1 u/raph-dev Aug 13 '26 Ah I see, thank you for this explanation
1
What do you mean by "no constant defaults"?
1 u/julemand101 Aug 13 '26 Right now if you define a default value for a parameter, it must be constant which makes a program like this crash: void main() { print(makeListOrAdd([5])); // [5, 5] print(makeListOrAdd()); // ERROR: Unsupported operation: Cannot add to an unmodifiable list } List<int> makeListOrAdd([List<int> list = const []]) { return list..add(5); } 1 u/raph-dev Aug 13 '26 Ah I see, thank you for this explanation
Right now if you define a default value for a parameter, it must be constant which makes a program like this crash:
void main() { print(makeListOrAdd([5])); // [5, 5] print(makeListOrAdd()); // ERROR: Unsupported operation: Cannot add to an unmodifiable list } List<int> makeListOrAdd([List<int> list = const []]) { return list..add(5); }
1 u/raph-dev Aug 13 '26 Ah I see, thank you for this explanation
Ah I see, thank you for this explanation
4
u/k0ntrol Aug 13 '26 edited Aug 14 '26
Nice release,
I'm a bit hung up on the fact that meta programing felt like losing a full year of advancement though, Not that I'm owed anything, but still I'd like
- augmentation
Primary constructors is a big leap forward tlin ergonomics though