D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3291 - Bad codegen when using templates with a named mixin as a parameter
Summary: Bad codegen when using templates with a named mixin as a parameter
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2009-09-03 13:16 UTC by Koroskin Denis
Modified: 2016-08-09 22:03 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 Koroskin Denis 2009-09-03 13:16:21 UTC
template Magic()
{
    int magic;
}

struct Item
{
    mixin Magic A;
}

struct Foo(alias S)
{
}

void main()
{
    Item* i1 = new Item;
    Item* i2 = new Item;

    Foo!(Item.A) bar; // comment-out this line for a successful run

    assert(i2.A.magic == 0);
    i1.A.magic = 42;
    assert(i2.A.magic == 0);
}

core.exception.AssertError@test.d(24): Assertion failure
Comment 1 ag0aep6g 2016-08-09 22:03:56 UTC
Assert passes since 2.061. Closing as WORKSFORME.