Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eponymous template FQN's re-state the template name #19582

Open
dlangBugzillaToGithub opened this issue Jun 13, 2019 · 7 comments
Open

Eponymous template FQN's re-state the template name #19582

dlangBugzillaToGithub opened this issue Jun 13, 2019 · 7 comments

Comments

@dlangBugzillaToGithub
Copy link

Manu reported this on 2019-06-13T21:20:24Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=19959

CC List

  • Rainer Schuetze

Description

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)`.
@dlangBugzillaToGithub
Copy link
Author

r.sagitario commented on 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.

@dlangBugzillaToGithub
Copy link
Author

turkeyman commented on 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?

@dlangBugzillaToGithub
Copy link
Author

r.sagitario commented on 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.

@dlangBugzillaToGithub
Copy link
Author

turkeyman commented on 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.

@dlangBugzillaToGithub
Copy link
Author

r.sagitario commented on 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...

@dlangBugzillaToGithub
Copy link
Author

turkeyman commented on 2019-08-30T17:23:27Z

Oh yeah, that's a very good point!
I've had that same thought many times.

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant