Summary: Warning Inside Template Causes Instantiation Error
           Product: D
           Version: 1.039
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: minor
          Priority: P2
         Component: DMD

void foo(T)(T arg)
    int i = 999;
    byte b = i;

void main()
    float f;

The above code compiles correctly with warnings disabled. But when warnings are
enabled, an template instantiation error is generated:

warning - main.d(4): Error: implicit conversion of expression (i) of type int
to byte can cause loss of data
main.d(10): template instance!(float) error instantiating

This might be related to #2567 and DMD's general treatment of warnings as


Reply via email to