Bug 18733 - When choosing "Go to declaration" in a method of an interface-typed variable, the full interface is not shown
Summary: When choosing "Go to declaration" in a method of an interface-typed variable,...
Status: RESOLVED INVALID
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Assembly browser ()
Version: Trunk
Hardware: PC Linux
: --- normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2014-04-02 08:04 UTC by Andres G. Aragoneses
Modified: 2014-04-02 11:14 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
no code (352.32 KB, image/png)
2014-04-02 09:51 UTC, Andres G. Aragoneses
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Andres G. Aragoneses 2014-04-02 08:04:58 UTC
If I have this code:

HttpWebResponse response;
response.Close ();

And I right-click on the Close() method -> Go to Declaration, then MonoDevelop properly decompiles the Close() method from the Mono class libraries and shows it to me in the assembly browser.

However, this doesn't work if I do the same for the Dispose() method below:

HttpWebResponse response;
((IDisposable)response).Dispose ();
Comment 1 Mike Krüger 2014-04-02 09:21:17 UTC
It does do the right thing - it jumps to the Dispose method of IDisposable which is correct.
Comment 2 Andres G. Aragoneses 2014-04-02 09:50:38 UTC
> it jumps to the Dispose method of IDisposable which is correct.

But it doesn't show the code, do you see the code? I'm attaching a screenshot.
Comment 3 Andres G. Aragoneses 2014-04-02 09:51:31 UTC
Created attachment 6457 [details]
no code
Comment 4 Mike Krüger 2014-04-02 10:00:22 UTC
which code does an interface member have ?
Comment 5 Andres G. Aragoneses 2014-04-02 10:11:08 UTC
> which code does an interface member have ?

In this particular case: https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/HttpWebResponse.cs#L319
Comment 6 Mike Krüger 2014-04-02 10:44:38 UTC
no this is not the code of the interface member - it has no body.
Comment 7 Andres G. Aragoneses 2014-04-02 10:47:31 UTC
What? There's a body there, click on the link I gave?

The body is a call to Dispose(false), how is that no body?

I'm completely confused here.
Comment 8 Mike Krüger 2014-04-02 10:48:59 UTC
You're at the wrong class - look at IDispose.
Comment 9 Mike Krüger 2014-04-02 10:49:18 UTC
IDisposable - you're calling Dispose there.
Comment 10 Andres G. Aragoneses 2014-04-02 10:50:08 UTC
Yes, but it's being case from an HttpWebResponse, I assume this can be inferred by MonoDevelop.
Comment 11 Andres G. Aragoneses 2014-04-02 10:50:23 UTC
s/case/cast/
Comment 12 Mike Krüger 2014-04-02 10:59:51 UTC
y it's cast - but the call goes to the casted object (IDisposable) that's why it jumps to that. It's like expected - you're expecting that go to definition simulates the program flow to find the member definition that's called at run time.

That's not really something that's in scope :)
Comment 13 Andres G. Aragoneses 2014-04-02 11:05:05 UTC
> That's not really something that's in scope :)

Ok, fair enough, but what really confused me here is that what is shown in the assembly browser is really poor:

using [...]

void Dispose();


That led me to believe that it was actually showing me the HttpWebResponse implementation, but failing to show the body. I think what should be shown here is:

interface IDisposable {

  ...other methods/properties...

  void Dispose(); <- focus this one

  ...other methods/properties...

}
Comment 14 Andres G. Aragoneses 2014-04-02 11:07:10 UTC
Oh, well, actually that is not shown in the other places either...

Mmmm, something tells me that this could be improved, but not sure how...

Designer help?
Comment 15 Mike Krüger 2014-04-02 11:14:28 UTC
hm, that would work better I think