degory / ghul

compiler for the ghūl programming language
https://ghul.dev
GNU Affero General Public License v3.0
4 stars 0 forks source link

Support instantiating types without new #1135

Closed degory closed 7 months ago

degory commented 7 months ago

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 commented 7 months ago

Duplicate. Fixed under #1141