[Issue 5776] New: DMD assert. failure on topN with custom comparison/data in inner function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 23 15:32:52 PDT 2011


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

           Summary: DMD assert. failure on topN with custom
                    comparison/data in inner function
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: magnus at hetland.org


--- Comment #0 from Magnus Lie Hetland <magnus at hetland.org> 2011-03-23 15:29:33 PDT ---
Running DMD 2.052 on OS X. When I try to compile the following program (two
files), by executing foo.d, I get the error

Assertion failed: (!vthis->csym), function toObjFile, file glue.c, line 703.

If I try to compile without myLess, I get:

Error: function std.algorithm.topN!("a < b",cast(SwapStrategy)0,uint[]).topN
compiler error, parameter 'r', bugzilla 2962?"

// foo.d:
#!/usr/bin/env rdmd -inline
import std.random;
import bar;
void main() {
    func();
}

// bar.d:
import std.algorithm;
void func() {
    bool myLess(uint a, uint b) {
        return a < b;
    }
    void inner(uint[] slice) {
        topN!myLess(slice, 0);
    }
}

-- 
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