D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4352 - Destructor of inner struct not callale
Summary: Destructor of inner struct not callale
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-19 22:49 UTC by Andrei Alexandrescu
Modified: 2012-06-01 04:11 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 Andrei Alexandrescu 2010-06-19 22:49:47 UTC
Compiling this:

struct Array(T)
{
    struct Payload
    {
        ~this()
        {
        }
    }
    RefCounted!(Payload, RefCountedAutoInitialize.no) _data;
}

unittest
{
    Array!int a;
}

ends with error message:

/home/andrei/code/dmd/phobos/std/typecons.d(365): Error: destructor test.Array!(int).Array.Payload.~this () is not callable using argument types ()

The reported location is mistaken too.
Comment 1 Andrei Alexandrescu 2010-06-19 23:00:02 UTC
Simpler example:

import std.typecons;

struct RefCounted(T)
{
    Tuple!(T, size_t) * _refCountedStore;
}

struct Payload
{
    ~this()
    {
    }
}

RefCounted!(Payload) _data;
Comment 2 Brad Anderson 2012-04-24 15:28:42 UTC
I get no error compiling either of these with DMD 2.059 on Windows.
Comment 3 Kenji Hara 2012-06-01 04:11:33 UTC
Works in 2.060head.