Bug 19959 – Eponymous template FQN's re-state the template name

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-13T21:20:24Z
Last change time
2024-12-13T19:03:54Z
Keywords
pull
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#19582 →

Comments

Comment #0 by turkeyman — 2019-06-13T21:20:24Z
In the interest of making it easier to interact with the debug experience, we need to shorten the symbol names. One big case of wasted horizontal space is eponymous templates, they often look like this: `myproject.packagex.sub_a.templatename(arg1, arg2).templatename.x` The useful data in that string is: `templatename(arg1, arg2).x` It seems that the fully-qualified name has the template name and args, but then the eponymous member of the template is re-stated. I think we could have an option to just remove that globally, so `templatename(arg1, arg2).templatename` would be `templatename(arg1, arg2)`.
Comment #1 by r.sagitario — 2019-06-15T12:52:25Z
This symbol is emitted by dmd. LDC already uses the abbreviated form "templatefunc!(arg1, arg2)()", but omits function parameter type information.
Comment #2 by turkeyman — 2019-06-15T18:37:19Z
Oh cool. I tend not to debug with LDC because of that weird yellow block that follows the cursor around ;) It would be ideal for DMD and LDC to have identical output; building debug with DMD and release with LDC is very common, and the debug experience changing substantially between configurations is not great :) > but omits function parameter type information. I'm not sure what you mean exactly; like, just doesn't show the args at all? So there is actual information loss? I don't think it's good to drop information. Do you know why it would do that?
Comment #3 by r.sagitario — 2019-06-15T19:03:17Z
>> but omits function parameter type information. >I'm not sure what you mean exactly; like, just doesn't show the args at all? >So there is actual information loss? Yes. > I don't think it's good to drop information. Do you know why it would do that? I guess it's just to keep the code simple? It seems it's not populated in the LDC part, but maybe the LLVM backend ignores this anyway? IIRC LDC doesn't add member functions to structs or classes, so you also cannot make "property-calls" in the debugger.
Comment #4 by turkeyman — 2019-06-15T19:37:14Z
Bummer. Seems we still have a ways to go. Well I think DMD is the more important experience, since people tend to use it when debugging, so we should focus on making that behave 'correctly' first, and then work to bring LDC in-line with DMD.
Comment #5 by r.sagitario — 2019-08-30T15:53:09Z
I think removing the duplicate template name can be done in error messages, too, e.g.: void foo(T)(T x) { } void main() { foo!int(); } test.d(8): Error: function `test.foo!int.foo(int x)` is not callable using argument types `()` test.d(8): missing argument for parameter #1: `int x` Changing this in Dsymbol.prettyChars() would probably propagate to the debug info. Reassigning to dmd...
Comment #6 by turkeyman — 2019-08-30T17:23:27Z
Oh yeah, that's a very good point! I've had that same thought many times.
Comment #7 by dlang-bot — 2020-02-27T21:15:36Z
@rainers created dlang/dmd pull request #10846 "fix Issue 19959 - Eponymous template FQN's re-state the template name" fixing this issue: - fix Issue 19959 - Eponymous template FQN's re-state the template name https://github.com/dlang/dmd/pull/10846
Comment #8 by robert.schadek — 2024-12-13T19:03:54Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19582 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB