[Issue 19084] New: Symbol not resolved in string mixin in template struct
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 13 17:45:50 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19084
Issue ID: 19084
Summary: Symbol not resolved in string mixin in template struct
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: rburners at gmail.com
I have this code
```
import std.format : format;
struct Bar(T) {
mixin(format("%s foo;", T.stringof)); // a) Error
// T foo; // b) Compiles
}
unittest {
struct Foo {
}
Bar!Foo bar;
}
```
which fails to compile with
"Error: undefined identifier Foo, did you mean variable foo?"
When I change a) to b) it compiles.
Not sure if this is a bug or not.
--
More information about the Digitalmars-d-bugs
mailing list