[Issue 12644] New: Some std.math functions are not yet @nogc

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 25 04:18:30 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12644

          Issue ID: 12644
           Summary: Some std.math functions are not yet @nogc
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

void main() @nogc {
    import std.math: floor, ceil, round, asin, atan2;
    auto x = floor(2.2);
    auto y = ceil(2.2);
    auto z = round(2.2);
    auto r1 = asin(1.0);
    auto r2 = atan2(1.0, 1.0);
}


DMD 2.066alpha gives:

test.d(3,19): Error: @nogc function 'D main' cannot call non- at nogc function
'std.math.floor'
test.d(4,18): Error: @nogc function 'D main' cannot call non- at nogc function
'std.math.ceil'
test.d(5,19): Error: @nogc function 'D main' cannot call non- at nogc function
'std.math.round'
test.d(6,19): Error: @nogc function 'D main' cannot call non- at nogc function
'std.math.asin'
test.d(7,20): Error: @nogc function 'D main' cannot call non- at nogc function
'std.math.atan2'

--


More information about the Digitalmars-d-bugs mailing list