-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nullable types are not assinable to a variable. #1553
Comments
Use this: Type typeOf<X>() => X;
void main() {
Type t = typeOf<int?>();
print(t);
} Cf. #123, I'll close this as a duplicate. |
Would the new typedef MaybeInt = int?
void main() {
Type t = MaybeInt;
print(t);
} |
@Levi-Lesches You can not typedef anything but functional types. |
That's being changed in #65, and hopefully releasing soon. Hopefully that should fix this pattern. |
It is indeed possible to use the new and more general kind of type alias (currently needing typedef MaybeInt = int?; However, I'd still recommend using something like |
Glad to hear that typedef of nonfunctional types is coming to dart. It will be beneficial when working with nested maps and lists. |
Thanks, @Reductions! I'll close this issue: It may be seen as a proposal to allow |
At the moment this is not posible:
Here is the error I get:
The text was updated successfully, but these errors were encountered: