language
language copied to clipboard
Design of the Dart language
The following function: ```dart int foo({int? arg}) { arg = 0; return (() => arg)(); } ``` Produces this error: ``` error • A value of type 'int?' can't be...
I'd like to import some features from functional languages like OCaML and F#. The main feature I'm proposing is the possibility of using `typedef` to define sum types. They can...
### Observed The [Dart Language Specification](https://spec.dart.dev/DartLangSpecDraft.pdf) contains the following statement in the section "Classes > Instance Methods > The Method noSuchMethod": > Note that it must be a method that...
So as of Dart 2.17, we can use super initializers inside the constructors. This reduces the code needed for classes that inherit from other classes and simplifies the code. Since...
Please see Dart [specification](https://spec.dart.dev/DartLangSpecDraft.pdf) 18.6.1. For loop > Execution of a for statement of the form `for (var v = e; c; e) s` proceeds as follows: > If `c`...
cf https://github.com/dart-lang/language/blob/master/working/macros/feature-specification.md#phase-3-definitions The doc of phase 2 explicitly mentions: "In this phase, macros declare functions, variables, and members. "Declaring" here means specifying the name and type signature, **but not the...
Another surprise (to me): ```dart void main() { String? foo = 'Foo'; if (foo?.toUpperCase() == 'FOO') { // Error: foo might be null. print(foo.toUpperCase(); } } ```
_This is currently under implementation: [implementation issue](https://github.com/dart-lang/sdk/issues/56188), [feature specification](https://github.com/dart-lang/language/blob/main/working/digit-separators/feature-specification.md)._ --- Solution to #1. To make long number literals more readable, allow authors to inject [digit group separators](https://en.wikipedia.org/wiki/Decimal_separator#Digit_grouping) inside numbers. Examples...
In response to https://github.com/dart-lang/language/issues/2308, this is a proposal to add support for _conditional instance members_ of classes and mixins, and _conditional constructors_ of classes. The intuitive meaning of such members...
This is the tracking issue for introducing a statically checked mechanism for declaration-site variance in Dart. Background: The original request motivating this kind of feature is dart-lang/sdk#213; the initial proposal...