-
-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Issue 17518 - [Reg 2.063] confusing error message with inout cons…
…tructor/ctor
- Loading branch information
Showing
2 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /* | ||
| TEST_OUTPUT: | ||
| --- | ||
| fail_compilation/fail17518.d(21): Error: constructor `fail17518.S.this(inout(Correct) _param_0) inout` is not callable using argument types `(Wrong)` | ||
| fail_compilation/fail17518.d(21): cannot pass argument `Wrong()` of type `Wrong` to parameter `inout(Correct) _param_0` | ||
| --- | ||
| */ | ||
|
|
||
| struct S | ||
| { | ||
| this(inout Correct) inout | ||
| { | ||
| } | ||
| } | ||
|
|
||
| struct Correct {} | ||
| struct Wrong {} | ||
|
|
||
| S bug() | ||
| { | ||
| return S(Wrong()); | ||
| } |