D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19306 - Explicit struct constructors aren't smart when the structs contain anonymous unions
Summary: Explicit struct constructors aren't smart when the structs contain anonymous ...
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-14 22:16 UTC by basile-z
Modified: 2024-12-13 19:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2018-10-14 22:16:16 UTC
struct Foo
{
    union
    {
        void delegate() a;
        void function() b;
    }
    ulong c;
}

void b(){}
struct A {void a(){}}

void main()
{
    A a;
    Foo f0 = Foo(&a.a);      // ok
    Foo f1 = Foo(&a.a, 0UL); // not allowed but should
    Foo f2 = Foo(&b, 0UL);   // not allowed but should
    Foo f3 = Foo(&b);        // not allowed but should
}
Comment 1 dlangBugzillaToGithub 2024-12-13 19:00:57 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19496

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB