language
language copied to clipboard
Design of the Dart language
The spec currently includes file access https://github.com/dart-lang/language/blob/main/working/macros/feature-specification.md#resources it either needs splitting out of the feature, or implementing :)
The language currently allows labels on switch cases. Then you can use a `continue` followed by a label name to jump from one case to any other chosen case in...
I would like to propose new semantics for RAII in Dart. For a class to be a resource, it should be annotated as `resource`, which requires the `dispose` method. For...
Here `ancestor` has initially type `Element?`, so cannot be promoted to either `ClassElement` or `ExtensionElement`. But it cannot be `null` if any of them is true. ```dart var ancestor =...
Allow declaring a class in the body of another class. ```dart class Person { class Occupation { String jobTitle; Occupation(this.jobTitle); String named(String name) => moniker(Person(name, this)); } String name; Occupation...
Today if I have two libraries that export classes with the same name, we get `ambiguous_import` if we try to use it. The suggested workarounds are to add an alias...
I'm not suggesting we don't add augmentations to the language. I just found this approach interesting enough that I want it documented, in case we ever reconsider. @mit-mit mentioned this...
I think it could be really interesting if we could create our own generators like `async`, `async*`, and `sync*` I noticed that really, a lot of the features present in...
**TL;DR**: All instance variables with initializer expressions of a class definition are initialized first thing, before invoking any non-redirecting generative constructor code. The the non-redirecting generative constructor code is executed...
Thanks to @sgrekhov for bringing up this situation. It is currently a [compile-time error](https://github.com/dart-lang/language/blob/aa8ee9d17b6c1c345ed7fb23a96c8c742cfcbe5c/specification/dartLangSpec.tex#L2416) for a named parameter to have a name whose first character is `_`. ```dart void f({int...