Bug 19286 – Aliases declared in static foreaches cannot be used with UFCS

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-10-03T14:08:45Z
Last change time
2020-01-14T05:22:49Z
Assigned to
No Owner
Creator
JR

Comments

Comment #0 by zorael — 2018-10-03T14:08:45Z
Manjaro/Arch x86_64, dmd v2.082.0. Also occurs on run.dlang.io. module aliastest; void foo(T)(string s) {} alias normalAlias = foo!string; mixin(q{ alias mixinAlias = foo!bool; }); static foreach (i; 0..1) { alias foreachAlias = foo!int; } void main() { normalAlias("normal"); "normal ufcs".normalAlias; mixinAlias("mixin"); "mixin ufcs".mixinAlias; foreachAlias("foreach"); "foreach ufcs".foreachAlias; // Error: no property foreachAlias for type string }
Comment #1 by boris2.9 — 2020-01-14T05:22:49Z
works from 2.087.1