Bug 12938 – Error message mistake in out parameter with @disable this

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-17T13:36:00Z
Last change time
2014-06-17T16:53:53Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-06-17T13:36:13Z
struct Foo { @disable this(); } void foo(out Foo x) {} void main() {} Gives a error message with a typo: test.d(4): Error: cannot have out parameter of type Foo because the default construction is disbaled
Comment #1 by maxim — 2014-06-17T13:56:39Z
It is not a bug. Some time ago I collected number of out problems, when code which should not be accepted is accepted and submitted them to bugzilla. The reason the code is rejected is because the struct has disabled init, so providing such value should be explicit only. In other words, the rejection reasoning is the same as rejecting S x;
Comment #2 by bearophile_hugs — 2014-06-17T14:01:47Z
(In reply to Maxim Fomin from comment #1) > It is not a bug. It is a bug, reopened. Please read my bug report first, at its text and importance. "disbaled" is surely a typo.
Comment #3 by maxim — 2014-06-17T14:23:07Z
(In reply to bearophile_hugs from comment #2) > (In reply to Maxim Fomin from comment #1) > > It is not a bug. > > It is a bug, reopened. Please read my bug report first, at its text and > importance. "disbaled" is surely a typo. I see, but the issue could have been more explicit.
Comment #4 by k.hara.pg — 2014-06-17T14:47:35Z
Comment #5 by github-bugzilla — 2014-06-17T16:53:52Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/561a96112e11e4e18d95c1159f9f58ad76f39606 fix Issue 12938 - Error message mistake in out parameter with @disable this https://github.com/D-Programming-Language/dmd/commit/2cca4abe5b3d7ea9ed14758ded01416f07511dc5 Merge pull request #3677 from 9rnsr/fix12938 Issue 12938 - Error message mistake in out parameter with @disable this