[Issue 21960] New: Error in enum implicit conversion to string reports wrong line number.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 24 03:42:59 UTC 2021


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

          Issue ID: 21960
           Summary: Error in enum implicit conversion to string reports
                    wrong line number.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: rmaicle at gmail.com

The following code produces the error: "cannot implicitly convert expression
`E.One` of type `E` to `string`" but reports the error to be in line 2. The
error is in line 5 where E.One is being assigned to Test.

~~~~~
import std.stdio;
enum E { One, Two }
void main() {
    enum R: string {
        Test = E.One
    }
    writeln(R.Test);
}
~~~~~

--


More information about the Digitalmars-d-bugs mailing list