On 01/01/2015 09:35 AM, Basile Burg wrote:

> On Tuesday, 30 December 2014 at 19:18:41 UTC, Basile Burg wrote:

> an ICE (every
> compiler crash is an ICE right ?),

Yes, the compiler should never crash but produce an error message. Please report it preferably with a reduced code sample:

  https://issues.dlang.org/

> not tested on trunk:

It has the same problem on git head.

>
> http://dpaste.dzfl.pl/70ab707b21e4
>
> e.g I try to get the getter delegate in order to set a new
> izPropDescriptor in an AA.

        foreach(m; __traits(allMembers, tp)) {
            foreach(o; __traits(getOverloads, tp, m)) {
                foreach(attr; __traits(getAttributes, o)) {
                    static if (is(attr == get)) {
                        writeln(attr.stringof, " < ", m);
                        alias PT = ReturnType!o;
                        //auto ICE = &o; //comment = no crash

You realize, all of those foreach'es are processed at compile-time for code generation. There will be no 'o' at run time; so its address cannot be used. The compiler problem is probably related to that.

                    } else if (is(attr == set)) {

You probably want that to be 'else static if'. Otherwise, when the previous 'static if' fails the condition, there will be an 'if' statement inserted, which would get executed at run time.

void main(string args[]){

Compiling with the -w compiler switch produces the following warning:

Warning: instead of C-style syntax, use D-style syntax 'string[] args'

Ali

Reply via email to