www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23267] New: statically evaluated code in betterC mask static

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

          Issue ID: 23267
           Summary: statically evaluated code in betterC mask static
                    assertion message with an unrelated error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: betterC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

compiles this with -betterC

```
import std.conv : to;
static assert(0, to!string(0));

extern(C) int main()
{
    return 0;
}    
```

to obtain

 Error: `TypeInfo` cannot be used with -betterC
this is because the code for to!string is incompatible with -betterC but in this case it is only statically evaluated. --
Jul 22 2022