[Issue 8514] New: dmd generate bug that segfault in very weird situation.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 6 13:40:15 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8514

           Summary: dmd generate bug that segfault in very weird
                    situation.
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: deadalnix at gmail.com


--- Comment #0 from deadalnix <deadalnix at gmail.com> 2012-08-06 13:40:13 PDT ---
A sample code :

module a.main;

class A {
    A[] a;
}

class B {
    A foo(A a) {
        return a;
    }
}

import std.algorithm;
import std.array;

auto bar(A a) {
    auto b = new B;
a.a.map!(s => b.foo(s)).array;
}

void main() {
    auto a1 = new A;
    auto a2 = new A;

    a1.a = [a2];

    bar(a1);
}

module b.b;

import std.string;

Linking both is important, as well as importing std.string . The usage of map
require the delegate to be templated one.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list