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

Should implicit constructors be introduced at the same time of introduction of inline classes? #3183

Open
Cat-sushi opened this issue Jun 30, 2023 · 1 comment
Labels
feature Proposed language feature that solves one or more problems

Comments

@Cat-sushi
Copy link

Cat-sushi commented Jun 30, 2023

Without implicit constructors,

inline class MyInt(int _) implements int;

void main() {
  var mi = MyInt(10);
  mi = MyInt(mi * 2);
}

With implicit constructors,

inline class implicit MyInt(int _) implements int;

void main() {
  MyInt mi = 10;
  mi *= 2;
}

cf. #108 #309

@Cat-sushi Cat-sushi added the feature Proposed language feature that solves one or more problems label Jun 30, 2023
@eernstg
Copy link
Member

eernstg commented Jun 30, 2023

I think implicit construction would need to wait a bit, because of resource constraints. It's definitely on the agenda, cf. #3040, but this may or may not get enough support from the rest of the language team... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems
Projects
None yet
Development

No branches or pull requests

2 participants