D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19959 - Eponymous template FQN's re-state the template name
Summary: Eponymous template FQN's re-state the template name
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-06-13 21:20 UTC by Manu
Modified: 2024-12-13 19:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2019-06-13 21:20:24 UTC
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 Rainer Schuetze 2019-06-15 12:52:25 UTC
This symbol is emitted by dmd. LDC already uses the abbreviated form "templatefunc!(arg1, arg2)()", but omits function parameter type information.
Comment 2 Manu 2019-06-15 18:37:19 UTC
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 Rainer Schuetze 2019-06-15 19:03:17 UTC
>> 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 Manu 2019-06-15 19:37:14 UTC
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 Rainer Schuetze 2019-08-30 15:53:09 UTC
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 Manu 2019-08-30 17:23:27 UTC
Oh yeah, that's a very good point!
I've had that same thought many times.
Comment 7 Dlang Bot 2020-02-27 21:15:36 UTC
@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 dlangBugzillaToGithub 2024-12-13 19:03:54 UTC
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