Bug 18415 – Typedef ignores @disabled default constructor

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-11T00:53:52Z
Last change time
2020-03-21T03:56:37Z
Keywords
pull
Assigned to
No Owner
Creator
Simen Kjaeraas

Comments

Comment #0 by simen.kjaras — 2018-02-11T00:53:52Z
When a type that has a disabled default constructor is used in std.typecons.Typedef, it's possible to create an uninitialized instance of the type, since Typedef doesn't disable its constructor: unittest { import std.typecons : Typedef; struct S { @disable this(); } //S s1; // Fails horribly. Typedef!S s1; // Compiles without issue. }
Comment #1 by b2.temp — 2018-05-18T18:17:04Z
Comment #2 by github-bugzilla — 2018-05-19T15:59:45Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/2cd3b5dac201c4168e242adfe94996fd67050f53 fix issue 18415 - Typedef ignores `@disabled` default constructor https://github.com/dlang/phobos/commit/b62baca794d34e37e113ef332c95c35f76f347af Merge pull request #6514 from BBasile/issue-18415 fix issue 18415 - Typedef ignores `@disabled` default constructor merged-on-behalf-of: MetaLang <[email protected]>