dmd
dmd copied to clipboard
fix Issue 23260 - If constructors have a function body, they should i…
…nfer attributes
This makes https://github.com/dlang/dmd/pull/14175 much more palatable.
Thanks for your pull request, @WalterBright!
Bugzilla references
| Auto-close | Bugzilla | Severity | Description |
|---|---|---|---|
| ✓ | 23260 | enhancement | If constructors have a function body, they should infer attributes |
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#14319"
All kinds of problems are cropping up, like https://github.com/dlang/dmd/pull/14320
What justifies that special case for ctors? And no, #14175 isn't a good reason.
Wouldn't it be better to have attribute that says "Hey infer the system attributes for this function" without using templates? Adding edge cases like these just seemed to be asking for trouble.
@kinke why isn't it a good reason? #14175 is a corruption opportunity specific to constructors.
@kinke if you have a better idea on how to close the memory safety hole, I'm interested.
if you have a better idea on how to close the memory safety hole, I'm interested.
https://github.com/dlang/dmd/pull/14175#discussion_r922852478
@kinke replied in #14175