[Issue 20119] New: "cannot inline default argument" of a mixin template alias parameter
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 11 00:50:21 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20119
Issue ID: 20119
Summary: "cannot inline default argument" of a mixin template
alias parameter
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: iamthewilsonator at hotmail.com
---
struct S
{
int data;
int pos = 5;
private:
mixin template auxdispatch(alias F, alias indx)
{
auto auxdispatch(int x = indx) //Error here
{
return F(x);
}
}
auto dispatcher(Func...)(int a)
{
alias Func0 = Func[0];
return Func0!()(a);
}
public:
void outer()
{
void nested()(int a)
{
data += a;
}
mixin auxdispatch!(nested,pos);
auxdispatch();
import std.stdio;
writeln(data);
}
}
void main()
{
S s;
s.outer();
}
---
fails with "onlineapp.d(8): Error: cannot inline default argument this.pos"
--
More information about the Digitalmars-d-bugs
mailing list