Bug 7678 - Compiling fail cs0584 on valid c# code
Summary: Compiling fail cs0584 on valid c# code
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-10-05 06:41 UTC by Alexander
Modified: 2012-10-05 08:47 UTC (History)
1 user (show)

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


Attachments
this code not compiled (616 bytes, text/plain)
2012-10-05 06:43 UTC, Alexander
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 GitHub or Developer Community 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 Alexander 2012-10-05 06:41:23 UTC
Description of Problem:


Steps to reproduce the problem:
1. xubuntu 12.04 amd64 Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
2. copy-paste attached file to new project, and try to compile. 

Actual Results: 

Main.cs(15,53): error CS0584: Internal compiler error: Object reference not set to an instance of an object
Main.cs(15,41): error CS0266: Cannot implicitly convert type `object' to `string'. An explicit conversion exists (are you missing a cast?)
Main.cs(15,41): error CS1662: Cannot convert `anonymous method' to delegate type `proba1.Proba.GetString' because some of the return types in the block are not implicitly convertible to the delegate return type


Additional Information:
If you uncomment function getTx(), then compile ok.
Comment 1 Alexander 2012-10-05 06:43:19 UTC
Created attachment 2695 [details]
this code not compiled
Comment 2 Alexander 2012-10-05 06:51:32 UTC
> gmcs --version

Mono C# compiler version 2.10.8.1
Comment 3 Marek Safar 2012-10-05 08:47:33 UTC
Already fixed in Mono 2.11