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

Allow calling constructors from operator output, input or property types #2107

Open
glopesdev opened this issue Jan 14, 2025 · 0 comments
Open
Labels
proposal Request for a new feature

Comments

@glopesdev
Copy link
Member

glopesdev commented Jan 14, 2025

Related to #742.

Constructing arbitrary type values remains a clunky operation in the current version of the language. The main reason which makes this process difficult is that calling a constructor requires a fully qualified type name. Typing the full name by hand would be error-prone and tedious. Introducing a namespace import feature would complicate the workflow syntax.

A better solution might be to allow operator output, input and property types to provide the context for the constructor call, with the operator simply applying existing type conversion semantics. This would allow creating something like a generic ConvertType operator which could double-down as an explicit casting and constructor.

@glopesdev glopesdev added the proposal Request for a new feature label Jan 14, 2025
@glopesdev glopesdev changed the title Add support for calling constructors from operator output, input or property types Allow calling constructors from operator output, input or property types Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant