[Issue 12656] New: Some functions in std.ascii can be @nogc

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Apr 26 10:10:34 PDT 2014


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

          Issue ID: 12656
           Summary: Some functions in std.ascii can be @nogc
           Product: D
           Version: D2
          Hardware: All
                OS: All
            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.ascii: toLower, toUpper, isLower, isUpper;
    auto c1 = toUpper('a');
    auto c2 = toLower('A');
    auto b1 = isLower('a');
    auto b2 = isUpper('A');
}


DMD 2.066alpha gives:

test.d(3,22): Error: @nogc function 'D main' cannot call non- at nogc function
'std.ascii.toUpper!char.toUpper'
test.d(4,22): Error: @nogc function 'D main' cannot call non- at nogc function
'std.ascii.toLower!char.toLower'
test.d(5,22): Error: @nogc function 'D main' cannot call non- at nogc function
'std.ascii.isLower'
test.d(6,22): Error: @nogc function 'D main' cannot call non- at nogc function
'std.ascii.isUpper'

--


More information about the Digitalmars-d-bugs mailing list