https://issues.dlang.org/show_bug.cgi?id=23074
Issue ID: 23074
Summary: premature enum type inference leads to spurious error
message
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
## test case
```
enum E { e1 = S.a }
struct S
{
E e;
enum a = "string";
}
```
## output
> /tmp/temp_7F3BFB9249F0.d:6:14: Error: cannot implicitly convert expression
> `"string"` of type `string` to `int`
## notes
- if you change the initializer of `S.a` to an integer literal then the program
compiles.
--