You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a new idea, why can't we ignore as T and implement automatic construction? For example:
voidmain() =>echo("Hello, Auto factory");
Constructor and factory selection
Beyond that, I think a lot of it is already clear what type of parameter position is required, and we can ignore the type flag and just use . to select static members of the type:
enumE { one, two }
voidecho(E select) =>print('Selected ${E}.${selecte.name}');
voidmain() {
echo(.one); // Full is `E.one`echo(.two);
}
The same is true for the construction entry selection of extension type/class:
First of all, this should be a syntactic sugar (🍬). The reason is that I have a type that has several factory functions, and the type is wrapped into a List.
Without it, the code:
finalList<PathConponent> paths = [
PathConponent('a'),
PathCompoinent.param('b'),
// ... and more
];
It's much simpler when you have autocomplete types:
basic
The
extension type
will be released soon in version 3.3, and it can currently be constructed viaas
:I have a new idea, why can't we ignore
as T
and implement automatic construction? For example:Constructor and factory selection
Beyond that, I think a lot of it is already clear what type of parameter position is required, and we can ignore the type flag and just use
.
to select static members of the type:The same is true for the construction entry selection of
extension type
/class
:Why do this?
First of all, this should be a syntactic sugar (🍬). The reason is that I have a type that has several factory functions, and the type is wrapped into a List.
Without it, the code:
It's much simpler when you have autocomplete types:
The text was updated successfully, but these errors were encountered: