-
-
Notifications
You must be signed in to change notification settings - Fork 670
Question: How to get the the generic type of Array? #262
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
Comments
Possibly related: #258 |
@dcodeIO Thanks for you reply. |
At this point I think that there must be a constructor with zero arguments for it to work, that is until this TODO has been addressed. |
@dcodeIO Thanks for you reply.
class A{
year: i32;
constructor(a: i32) {
if ( a < 1900) {
this.year = 1900;
}
this.year = a;
}
} In that case calling the ctor with default parameter value (basic type value is 0, object type is null or {}) maybe a choice. |
@dcodeIO Could we close this for now? |
Yeah, seems this is pretty similar to #262, which is our tracking issue now. |
Just my sentiment here, but stuff like Is there another way to allow the same thing in AS, while being compatible with TypeScript? |
|
The requirement is to create obj by generic type.
The text was updated successfully, but these errors were encountered: