-
-
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.
Merge pull request #5515 from 9rnsr/fix15744
[REG2.067] Issue 15744 - (SIGABRT) Error: overloadset t.Bar.__ctor is aliased to a function
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 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,57 @@ | ||
| /* | ||
| TEST_OUTPUT: | ||
| --- | ||
| fail_compilation/ice15744.d(17): Error: overloadset ice15744.S.__ctor is aliased to a function | ||
| fail_compilation/ice15744.d(53): Error: template instance ice15744.S.AddField!string.__ctor!(int) error instantiating | ||
| fail_compilation/ice15744.d(41): Error: overloadset ice15744.B.__ctor is aliased to a function | ||
| fail_compilation/ice15744.d(54): Error: template instance ice15744.C.__ctor!(string, int) error instantiating | ||
| --- | ||
| */ | ||
|
|
||
| template AddField(T) | ||
| { | ||
| T b; | ||
| this(Args...)(T b, auto ref Args args) | ||
| { | ||
| this.b = b; | ||
| this(args); | ||
| } | ||
| } | ||
|
|
||
| template construcotrs() | ||
| { | ||
| int a; | ||
| this(int a) | ||
| { | ||
| this.a = a; | ||
| } | ||
| } | ||
|
|
||
| class B | ||
| { | ||
| mixin construcotrs; | ||
| mixin AddField!(string); | ||
| } | ||
|
|
||
| class C : B | ||
| { | ||
| this(A...)(A args) | ||
| { | ||
| // The called super ctor is an overload set. | ||
| super(args); | ||
| } | ||
| } | ||
|
|
||
| struct S | ||
| { | ||
| mixin construcotrs; | ||
| mixin AddField!(string); | ||
| } | ||
|
|
||
| void main() | ||
| { | ||
| auto s = S("bar", 15); | ||
| auto c = new C("bar", 15); | ||
| } | ||
|
|
||
| // Note: This test case should be accepted finally. See issue 15784. |