Bug 20119 – "cannot inline default argument" of a mixin template alias parameter

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-11T00:50:21Z
Last change time
2024-12-13T19:04:49Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Nicholas Wilson
Moved to GitHub: dmd#19605 →

Comments

Comment #0 by iamthewilsonator — 2019-08-11T00:50:21Z
--- 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"
Comment #1 by robert.schadek — 2024-12-13T19:04:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19605 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB