Bug 21960 – Error in enum implicit conversion to string reports wrong line number.

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-05-24T03:42:59Z
Last change time
2024-12-13T19:16:35Z
Assigned to
No Owner
Creator
ricky maicle
Moved to GitHub: dmd#18035 →

Comments

Comment #0 by rmaicle — 2021-05-24T03:42:59Z
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); } ~~~~~
Comment #1 by robert.schadek — 2024-12-13T19:16:35Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18035 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB