Don't allow short constructor with non-void expression except this() and super() (#17489)

This commit is contained in:
Nick Treleaven 2024-12-08 09:21:42 +00:00 committed by GitHub
parent a13b00fab1
commit a7f6b04a0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 2 deletions

View file

@ -15,7 +15,7 @@ class A {
bool isNull() => this is null;
this() {}
this(int x) => _x = x;
this(int x) { _x = x; }
this(float y) => this(cast(int) y);
}