language
language copied to clipboard
Design of the Dart language
Leaf and Lasse, I believe you might discuss this PR and decide on whether one of you would give it a review. For now I'm just putting it on github...
The proposal for structs and extension structs [here](https://github.com/dart-lang/language/issues/2360) uses the declaration forms: ```dart struct Foo(int x, int y) { // members here } extension struct Bar(int x) { // members...
A primary constructor declares "parameters" that implicitly define both constructor parameters and fields (instance variables). We allow metadata on both constructor parameters and fields. If someone wants to apply metadata...
In the extension struct proposal (#2360) I initially propose to disallow extension structs to extend other extension structs. #2368 discusses whether to allow this. If we allow this, the question...
During my work on #2020, I've discovered that the following flow control behaviours only take effect if the expression `e` is a reference to a local variable: - ~~Control flow...
The `is` operator in dart can check whether an instance is a type of another type. ```dart int a = 1; Object b = a; b is int // true...
The extension struct proposal [here](https://github.com/dart-lang/language/issues/2360) ties together structs and extension structs in two ways: it uses overlapping syntax (the `struct` keyword), and it has a goal that the constructs may...
The current record proposal provides no notation for accessing a single positional field: ``` Positional fields are not exposed as getters. Record patterns in pattern matching can be used to...
_[Update: There is considerable interest on the team in adding primary constructors as a general feature. This original discussion issue has been repurposed as the tracking issue for the general...
```dart // Let A be a class class A {} // Let X be a method taking a type argument void X(){} // Calling X with A as a type...