Bug 17809 – "this" is implicitly captured by template with alias parameter

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-09-05T14:42:47Z
Last change time
2024-12-13T18:54:26Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
John Colvin
Moved to GitHub: dmd#19313 →

Comments

Comment #0 by john.loughran.colvin — 2017-09-05T14:42:47Z
template A() { auto A() { return this; } } template B(alias a) { auto B() { return this; } } struct S { int a; // Error: 'this' is only defined in non-static member functions, not A alias foo0 = A!(); // OK ??? I don't think this should work alias foo1 = B!(a); }
Comment #1 by nick — 2022-09-14T13:18:00Z
Confirmed with dmd v2.100.2-beta.1-dirty.
Comment #2 by robert.schadek — 2024-12-13T18:54:26Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19313 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB