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 #5368 from MartinNowak/fix15550
fix Issue 15550 - compile error while testing template constraint
- Loading branch information
Showing
5 changed files
with
52 additions
and
10 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
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,13 @@ | ||
struct Vector(T, int N) | ||
{ | ||
void opDispatch(string, U)(U) | ||
{ | ||
} | ||
|
||
void baz(string, U)(U) | ||
{ | ||
} | ||
} | ||
|
||
static assert(!is(typeof(Vector!(int, 2)._isMatrix))); | ||
static assert(!is(typeof(Vector!(int, 2).baz!"_isMatrix"))); |
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,27 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail15550.d(25): Error: expression (foo!int) has no type | ||
fail_compilation/fail15550.d(26): Error: expression (opDispatch!"_isMatrix") has no type | ||
fail_compilation/fail15550.d(27): Error: expression (baz!"_isMatrix") has no type | ||
--- | ||
*/ | ||
|
||
T foo(T, T2)(T2) | ||
{ | ||
} | ||
|
||
struct Vector | ||
{ | ||
void opDispatch(string, U)(U) | ||
{ | ||
} | ||
|
||
void baz(string, U)(U) | ||
{ | ||
} | ||
} | ||
|
||
alias T1 = typeof(foo!int); | ||
alias T2 = typeof(Vector._isMatrix); | ||
alias T3 = typeof(Vector.baz!"_isMatrix"); |