D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3705 - Can't add structs with alias this to an AA.
Summary: Can't add structs with alias this to an AA.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 major
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-01-14 08:37 UTC by David Simcha
Modified: 2015-06-09 01:27 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 David Simcha 2010-01-14 08:37:31 UTC
struct Foo {

    alias returnOne this;

    uint returnOne() {
        return 1;
    }
}

void main() {
    Foo[string] AA;
    AA["bar"] = Foo.init;
}


Errors:

test.d(12): Error: function test.Foo.returnOne () is not callable using argument types (Foo)
test.d(12): Error: expected 0 arguments, not 1 for non-variadic function type uint()
Comment 1 Don 2010-11-01 13:35:25 UTC
Fixed DMD2.050.