D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10766 - Variant does not accept pointers to incomplete (opaque) types
Summary: Variant does not accept pointers to incomplete (opaque) types
Status: RESOLVED DUPLICATE of issue 10451
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-06 09:11 UTC by Ali Cehreli
Modified: 2013-09-28 23:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ali Cehreli 2013-08-06 09:11:38 UTC
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 Manu 2013-08-31 17:43:23 UTC
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
Comment 3 Kenji Hara 2013-09-28 23:02:28 UTC

*** This issue has been marked as a duplicate of issue 10451 ***