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 #3878 from 9rnsr/fix13333
Issue 13333 - Incorrect error ungagging during the resolution of forward references
- Loading branch information
1 parent
5fed9e6
commit 9b23adf
Showing
11 changed files
with
142 additions
and
45 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
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
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
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,40 @@ | ||
/* | ||
TEST_OUTPUT* | ||
--- | ||
fail_compilation/diag13333.d(29): Error: template instance VariantN!(maxSize!(S), T) recursive template expansion | ||
fail_compilation/diag13333.d(29): Error: template instance diag13333.maxSize!(S) error instantiating | ||
fail_compilation/diag13333.d(34): instantiated from here: Algebraic!(S) | ||
--- | ||
*/ | ||
|
||
template maxSize(T...) | ||
{ | ||
static if (T.length == 1) | ||
{ | ||
enum size_t maxSize = T[0].sizeof; | ||
} | ||
else | ||
{ | ||
enum size_t maxSize = T[0].sizeof >= maxSize!(T[1 .. $]) | ||
? T[0].sizeof : maxSize!(T[1 .. $]); | ||
} | ||
} | ||
|
||
struct VariantN(size_t maxDataSize, AllowedTypesX...) | ||
{ | ||
} | ||
|
||
template Algebraic(T...) | ||
{ | ||
alias Algebraic = VariantN!(maxSize!T, T); | ||
} | ||
|
||
struct DummyScope | ||
{ | ||
alias A = Algebraic!S; | ||
|
||
static struct S // <- class | ||
{ | ||
A entity; | ||
} | ||
} |
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