Bug 10766 – Variant does not accept pointers to incomplete (opaque) types
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-06T09:11:00Z
Last change time
2013-09-28T23:02:28Z
Assigned to
nobody
Creator
acehreli
Comments
Comment #0 by acehreli — 2013-08-06T09:11:38Z
import std.stdio;
import std.variant;
struct S;
void main()
{
S * p;
auto v = Variant(p);
}
Error: struct deneme.S is forward referenced when looking for 'toHash'
Error: struct deneme.S is forward referenced when looking for 'toString'
Error: struct deneme.S unknown size
Error: struct deneme.S no size yet for forward reference
Error: struct deneme.S unknown size
Error: struct deneme.S no size yet for forward reference
Being a user of Variant, std.concurrency is affected when sending messages of pointers to opaque types.
Ali
Comment #1 by turkeyman — 2013-08-31T17:43:23Z
Same issue perhaps?
struct MyStruct;
MyStruct*[] arrayOfPointers;
arrayOfPointers ~= null; // fail
arrayOfPointers = new MyStruct*[n]; // also fail
Complains:
Error: struct MyStruct is forward referenced when looking for 'toHash'
Error: struct MyStruct is forward referenced when looking for 'opCmp'
Error: struct MyStruct is forward referenced when looking for 'toString'
Error: struct MyStruct unknown size
Error: struct MyStruct no size yet for forward reference
Error: struct MyStruct unknown size
Error: struct MyStruct no size yet for forward reference