mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Fix Bugzilla 24599 - Wrongly elided TypeInfo emission (#15868)
Reverting #14844, which caused such missing TypeInfos, *and* making sure the special TypeInfo members are fully analyzed and ready for codegen (otherwise hitting an assertion for the real-world project).
This commit is contained in:
parent
6a8ce7c32a
commit
7ab98b931a
8 changed files with 37 additions and 30 deletions
|
@ -1,13 +0,0 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=23650
|
||||
|
||||
__gshared int x;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
static assert(__traits(compiles,
|
||||
{
|
||||
struct S { int *p = &x; }
|
||||
auto t = typeid(S);
|
||||
}));
|
||||
}
|
24
compiler/test/runnable/test24599.d
Normal file
24
compiler/test/runnable/test24599.d
Normal file
|
@ -0,0 +1,24 @@
|
|||
module mod;
|
||||
|
||||
struct Variable
|
||||
{
|
||||
size_t toHash() const { return 0; }
|
||||
}
|
||||
|
||||
enum hasInoutConstruction(T) = __traits(compiles, { struct S { T a; } });
|
||||
|
||||
struct Algebraic(T)
|
||||
{
|
||||
static if (hasInoutConstruction!T)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Algebraic!Variable foo();
|
||||
|
||||
struct S
|
||||
{
|
||||
Variable[] symbols;
|
||||
}
|
||||
|
||||
void main() {}
|
Loading…
Add table
Add a link
Reference in a new issue