Bug 12206 – Can't "alias this" to a template instantiation

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-19T15:43:46Z
Last change time
2024-12-13T18:17:10Z
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#18776 →

Comments

Comment #0 by dlang-bugzilla — 2014-02-19T15:43:46Z
template T() { void foo() {} } struct S { alias t = T!(); alias t this; } void main() { S s; s.foo(); }
Comment #1 by schuetzm — 2015-03-15T16:33:45Z
Still there in DMD master. The error message is: xx.d(15): Error: expression has no value
Comment #2 by razvan.nitu1305 — 2018-10-19T14:01:25Z
This is a weird case. The alias is part of the struct, but the actual function is not. I would say that the correct behavior is the current one: Error : no property foo for type S. Note that writing s.t.foo works. In my opinion, this is the real bug.
Comment #3 by robert.schadek — 2024-12-13T18:17:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18776 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB