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.