Bug 16042 – Identifier on template arguments should consider eponymous member lookup

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-05-18T11:51:55Z
Last change time
2017-12-29T05:27:57Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Kenji Hara

Comments

Comment #0 by k.hara.pg — 2016-05-18T11:51:55Z
From a forum post: http://forum.dlang.org/thread/[email protected] Sadly dmd has multiple analysis pass for equivalent code. The reduced case is: struct Foo {} void map(alias func, T)(T t) { func(t); } auto toChars(R)(R r) if (is(R == int[])) { Foo f; toChars(f); // OK [1] //map!(toChars)(f); // NG [2] map!((toChars))(f); // OK [3] } auto toChars(Foo f) { } void main() { [1].toChars(); } In [3], '(toChars)' is parsed as an expression, then it will get same semantic analysis pass with [1]. But in [2], 'toChars' is parsed as a type, and its analysis is different from [2] or [3].
Comment #1 by k.hara.pg — 2016-05-18T12:01:23Z
Comment #2 by bugzilla — 2017-12-29T05:24:23Z
Comment #3 by github-bugzilla — 2017-12-29T05:27:56Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b2a5fb82d6506291b8a0c72c1e24dc2befb75226 Fix Issue 16042 - Identifier on template arguments should consider eponymous member lookup https://github.com/dlang/dmd/commit/5470151e344655df97b2edd3a283e2ea79a6aa75 Merge pull request #7404 from JinShil/fix_16042 Fix Issue 16042 - Identifier on template arguments should consider eponymous member lookup