Skip to content
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

Support instantiating types without new #1135

Closed
degory opened this issue Mar 26, 2024 · 1 comment
Closed

Support instantiating types without new #1135

degory opened this issue Mar 26, 2024 · 1 comment

Comments

@degory
Copy link
Owner

degory commented Mar 26, 2024

It would be useful to be able to instantiate types without having to type new. For generic types (or any other type where the type expression is not just a qualified identifier) this is awkward, because it would make expression parsing ambiguous (#883), but we could still support it for non generic types. Plus, we could support type aliases for generic type specializations, and those aliases could be instantiated without new.

class THING is
    value: string;
    init(value: string) is self.value = value; si
si

...
let t = THING("test");
@degory
Copy link
Owner Author

degory commented Mar 31, 2024

Duplicate. Fixed under #1141

@degory degory closed this as completed Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant