Bug 30067 - [roslyn] "async" should not be generated for overrides
Summary: [roslyn] "async" should not be generated for overrides
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Linux
: --- minor
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2015-05-14 05:21 UTC by Atsushi Eno
Modified: 2015-05-15 03:35 UTC (History)
1 user (show)

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

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 FIXED

Description Atsushi Eno 2015-05-14 05:21:26 UTC
In the code below, suppose you are going to overide method "X" in D class.

----
using System;
using System.Threading.Tasks;

class B
{
	public virtual async Task<B> X ()
	{
		return new B ();
	}
}

class D : B
{
}
----

On the text editor, you type "override" and get override candidates. Select "X()..."

The resulting D class looks like this:

----
class D : B
{
	public override async Task<B> X ()
	{
		return base.X ();
	}
}
----

It doesn't compile. Because by having "async" keyword, it is expected to return B, not Task<B>. But base.X() returns Task.

VS2015 doesn't seem to add this "async".

Note that if you are overriding a method from different assembly, you won't get "async" in the generated signature (because "async" does not exist in the resulting dll).
Comment 1 xamarin-release-manager 2015-05-15 03:35:03 UTC
Fixed in version 6.0.0.2103 (roslyn)