www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17273] New: why is a const range not a range

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

          Issue ID: 17273
           Summary: why is a const range not a range
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: sahmi.soulaimane gmail.com

the following code works for me. the second assert should fail:

import std.range;

unittest
{
    static assert(isInputRange!(InputRange!int));
    static assert(!isInputRange!(const(InputRange!int)));
}

$ dmd --version
DMD32 D Compiler v2.073.0
Copyright (c) 1999-2016 by Digital Mars written by Walter Bright

--
Mar 24