-
Notifications
You must be signed in to change notification settings - Fork 0
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
Don't require new
in constructor expressions
#1141
Labels
Comments
degory
added a commit
that referenced
this issue
Mar 29, 2024
degory
added a commit
that referenced
this issue
Mar 30, 2024
Enhancements: - Hint that `new` is deprecated and can be omitted (see #1141) Technical: - Remove use of `new` thoughout compiler and integration tests
Merged
This was referenced Mar 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, constructor expressions require the
new
keyword. The main reason for this is that we can't parse generic type expressions in a value expression context, sonew
is needed to explicitly tell the parser to expect a type expression.It would be good to support construction without needing
new
.new
is often associated with OOP object construction, but some of the valuesnew
constructs in ghūl are not objects (e.g., structs, union variants). Whilenew
does highlight that construction is special compared to a regular method call, you could argue that(...)
already signals an arbitrary amount of work could happen, including object construction and side effects:new
on top of(...)
doesn't add any further information.Once we have a solution for #883 we will be able to recognize constructor expressions without needing them to be preceded by
new
To support bootstrapping and until
ghul-test
and the runtime library are updated to remove use ofnew
, we will need to support constructor expressions with and withoutnew
.The text was updated successfully, but these errors were encountered: