D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6460 - [CTFE] internal error assigning struct
Summary: [CTFE] internal error assigning struct
Status: RESOLVED DUPLICATE of issue 6419
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-09 13:56 UTC by Dmitry Olshansky
Modified: 2011-08-11 23:39 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dmitry Olshansky 2011-08-09 13:56:27 UTC
Test case:

int f()
{
    struct FixedStack(T)
    {
        T[] arr;
//commenting out this constructor makes it work
        this(T[] storage){   arr = storage;  }

    }
    auto counterRange = FixedStack!uint(new uint[22]);
    return 0;
}

enum k = f();

dmd's output:
struct.d(9): Error: CTFE internal error assigning struct
struct.d(13): Error: cannot evaluate f() at compile time
Comment 1 Ellery Newcomer 2011-08-11 18:41:53 UTC
I ran into this a while ago:

import std.algorithm;
void main(){
    size_t findi(string s){
        return countUntil(s,'d');
    };
    enum x = map!findi(["a","b"]);
}



on my example dmd also segfaults.
Comment 2 Don 2011-08-11 23:39:26 UTC

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