Bug 23017 - Mono C# compiler incorrectly emits CS1061 when using lambdas and type constraints
Summary: Mono C# compiler incorrectly emits CS1061 when using lambdas and type constra...
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 3.8.0
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-09-15 12:59 UTC by Calum
Modified: 2014-09-22 16:13 UTC (History)
1 user (show)

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


Attachments
Program which demonstrates the bug (721 bytes, text/plain)
2014-09-15 12:59 UTC, Calum
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 Calum 2014-09-15 12:59:04 UTC
Created attachment 8068 [details]
Program which demonstrates the bug

The attached program fails to compile on Mono. 

This program compiles successfully on the Microsoft compiler, csc.exe, and in Visual Studio.

This error reproduces on various versions of mcs as follows:

=================
Error on mcs 3.10:

calum@sticky:~$ mono -V
Mono JIT compiler version 3.10.1 (master/7f6a464 Fri Sep 12 11:48:01 BST 2014)

calum@sticky:~$ mcs /mnt/stick/dev/projects/Sandbox/Sandbox/Program.cs 
/mnt/stick/dev/projects/Sandbox/Sandbox/Program.cs(32,18): error CS1061: Type `Foo' does not contain a definition for `Value' and no extension method `Value' of type `Foo' could be found. Are you missing an assembly reference?
/mnt/stick/dev/projects/Sandbox/Sandbox/Program.cs(30,34): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings

=====================
Error on mcs 3.2.3 on Windows:

L:\dev\projects\Sandbox\Sandbox>"C:\Program Files (x86)\Mono-3.2.3\bin\mcs".bat Program.cs
Program.cs(32,18): error CS1061: Type `Foo' does not contain a definition for `Value' and no extensi
on method `Value' of type `Foo' could be found. Are you missing an assembly reference?
Program.cs(30,34): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings

======================
Successful output of csc.exe:

L:\dev\projects\Sandbox\Sandbox>"C:\Program Files (x86)\MSBuild\12.0\Bin\csc.exe" Program.cs
Microsoft (R) Visual C# Compiler version 12.0.30501.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.

=========================
Comment 1 Marek Safar 2014-09-22 16:13:19 UTC
Fixed in master