Bug 20553 – Request to improve documentation of how alias declaration and alias parameter work with function overload sets

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-02-01T08:30:25Z
Last change time
2024-12-13T19:06:58Z
Assigned to
No Owner
Creator
Uranuz
Moved to GitHub: dmd#19662 →

Comments

Comment #0 by neuranuz — 2020-02-01T08:30:25Z
There are currently unclear by language documentation how the language works when trying to get `alias` or pass `alias` template parameter when dealing with function overload sets. https://dlang.org/spec/template.html#alias-template https://dlang.org/spec/declaration.html#alias The question can be illustrated by simple example below: void foo(string aaa) {} void foo(string aaa, int bb) {} template Bar(alias Func) { //... } alias MyBar = Bar!foo; After just reading documentation it's hard to reason what do I actuall pass to Bar template in this example. Do I pass just the first overload of foo to bar? Or do I pass the last one? Or do I pass entire overload set? The same is for `plain` aliases: alias myFoo = foo; What is `myFoo` actually? I cannot say it for sure after reading docs. Also this misundersanding could be when using some of the other language constructs with overloads. For instance `typeof`: https://dlang.org/spec/declaration.html#Typeof And maybe there a other cases that I couldn't figure out yet. It's pretty like the `gray zone` of the language. I can't get straight answer without testing it at practice.
Comment #1 by robert.schadek — 2024-12-13T19:06:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19662 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB