-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow class objects in constructors #8486
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
This seems like a language tour thing. Set owner to @kwalrath. |
This comment was originally written by [email protected] i'm freaking up to do this function in my game framework: instance_create(x, y, obj) { there is a chance to do this in someway ? |
This comment was originally written by [email protected] i can't do: instance_create(x, y, new obj()) etc... collideMethodWith(class) etc... |
Is this a doc request or a language request? |
This comment was originally written by [email protected] language request |
Reassigning to Gilad. Set owner to @gbracha. |
Allowing this sort of thing is very attractive. We have to be sure of the implications, especially for JS compilation. So, yes, we are considering it, but it may be a while. In the meantime, reflection can help (at least on the VM). Added Accepted label. |
This comment was originally written by [email protected] Added Priority-Medium label. |
Duplicate of #10667. |
This issue was originally filed by [email protected]
please add the class name reference by argument, like this example:
class Foo {
}
main() {
myFunction(Foo);
}
myFunction(class) {
class f = new class(); //class = Foo
}
The text was updated successfully, but these errors were encountered: