www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24533] New: clamp with smaller-than-int T1 fails to compile

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

          Issue ID: 24533
           Summary: clamp with smaller-than-int T1 fails to compile with
                    literal parameters
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

Since DMD 2.099, this code fails to compile:
```
assert(clamp(ubyte(4), 1, 5) == 4);
```

Likely cause is https://github.com/dlang/phobos/pull/8293

--
May 03