[Issue 18386] New: mixin ... isn't a template error when used in new scope
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 6 22:30:31 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18386
Issue ID: 18386
Summary: mixin ... isn't a template error when used in new
scope
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: tetyys at tetyys.com
Compilation of this code:
import std.stdio;
void main() { }
class c {
this() {
enum string b(alias d)() {
return `writeln("a");`;
}
int a;
{
mixin b!a;
mixin b!a;
}
}
}
fails with dmd v2.078.1 and error
test.d(11): Error: mixin b!a b isn't a template
However, code:
import std.stdio;
void main() { }
class c {
this() {
enum string b(alias d)() {
return `writeln("a");`;
}
int a;
//{
mixin b!a;
mixin b!a;
//}
}
}
compiles successfully
--
More information about the Digitalmars-d-bugs
mailing list