Bug 18827 - Incorrect error on return of type Task
Summary: Incorrect error on return of type Task
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.3.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2014-04-05 20:29 UTC by James Clancey
Modified: 2014-04-07 03:51 UTC (History)
2 users (show)

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:

Description James Clancey 2014-04-05 20:29:33 UTC
The following code gives an error but it is valid and still compiles
"Error Foo: A return must be followed by an expression when method returns a value"

public async Task Foo()
Comment 1 Sadik Ali 2014-04-07 03:44:55 UTC
I have checked this issue but I am unable to reproduce this.


1. Created console project.
2. added function mentioned in bug description.
3. called this function in main method.
4. Build and run application successfully.

Screen cast: http://screencast.com/t/QZMtGD1A3l2

Build Info:

Xamarin Studio
Version 4.3.0 (build 52)
Installation UUID: f5b0e4eb-1c2b-45c1-8bc2-1fcd6b942f94
	Mono 3.2.6 ((no/9b58377)
	GTK+ 2.24.23 theme: Raleigh
	GTK# (
	Package version: 302060000

Build Information
Release ID: 403000052
Git revision: cd02fcfb350930f468f3d7cbf8e39f940553d378
Xamarin addins: 14d41853742c36662973f9bbc0d14e58befdebfb

Operating System
Mac OS X 10.8.5
Darwin localhost 12.5.0 Darwin Kernel Version 12.5.0
    Sun Sep 29 13:33:47 PDT 2013
    root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 

Also I have checked on latest stable XS build 4.2.3 (Build 60) and 4.3.4 (Build 0) but not able to reproduce.

Please let me know if I need add any addition code in function or missing any steps.
Comment 2 Mike Krüger 2014-04-07 03:51:56 UTC
Works for me with 'master' (=retina). I checked that this case is part of our unit tests.