Comments (3)
Only allowing implementation of named types was a deliberate choice—you can see an explanation at #3693 (comment).
from language.
@mmcdon20 fair point!
I don't see this being implemented anytime soon, but I agree that it'd be really nice :)
from language.
@nate-thegrate It sounds like it would be possible to allow this behavior, just that it hasn't been done yet due to being more complicated than named types to implement.
Also in some sense, the feature partially exists already in that you can cast the extension type to the representation type successfully.
extension type Coordinate(({double latitude, double longitude}) _) {}
void main() {
Coordinate coordinate = Coordinate((latitude: 5, longitude: 10));
({double latitude, double longitude}) tuple =
coordinate as ({double latitude, double longitude});
print(tuple.latitude);
}
But it would be a lot more convenient to use if it did not require casting.
from language.
Related Issues (20)
- Make duplication of superinterfaces a warning, not an error HOT 3
- Is it possible to augment the `values` of an enum? HOT 6
- How can we augment an abstract variable? HOT 18
- Enforce strict method override behavior in Dart HOT 4
- Allow `augmented` as the name of a named argument or as a member name? HOT 3
- Allow `with` as function name HOT 4
- Allow use switch expression to init a const variable HOT 2
- Parameter name of implicit setter. HOT 7
- Add `yield` to collection for HOT 3
- Do we allow constructors whose implementation is omitted, but provided by augmentation? HOT 2
- Make `augmented` an error in the body of a non-redirecting generative constructor? HOT 4
- Should reading of wildcard variables be allowed in the inferred code? HOT 12
- Would Replacing LateInitializationError with LateInitializationException Be More Intuitive? HOT 3
- Better error handling - Is it possible to add "if exception" operator HOT 11
- Nullable function check with '??' causes both sides to be executed HOT 9
- Le
- Enhance override inference to infer type parameter bounds
- Allow accessing `Enum.values` inside extensions and mixins HOT 8
- URI shorthands, not for parts
- `augmented()` can't occur in an initializer list of an augmenting constructor declaration, right? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language.