Bug 43728 - Compiler Errors on valid < Expression
Summary: Compiler Errors on valid < Expression
Status: RESOLVED FEATURE
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-08-25 02:57 UTC by Jonathan Chambers
Modified: 2016-08-26 13:03 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 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 FEATURE

Description Jonathan Chambers 2016-08-25 02:57:53 UTC
The following code fails to compile:

using System;

class MainClass
{
	public static void Main(string[] args)
	{
		var a = 42;
		Console.WriteLine("{0} {1}", 1 < a, a > 1);
	}
}


If we put parenthesis around the first expression it compiles fine:
using System;

class MainClass
{
	public static void Main(string[] args)
	{
		var a = 42;
		Console.WriteLine("{0} {1}", (1 < a), a > 1);
	}
}
Comment 1 Marek Safar 2016-08-26 08:44:23 UTC
Sadly this is our parser well known limitation which is not easy to fix.

I think it was firstly reported 10 years ago
Comment 2 Jonathan Chambers 2016-08-26 11:46:05 UTC
:-(

Thanks for the info.
Comment 3 Jonathan Chambers 2016-08-26 13:03:08 UTC
Closing as this is unlikely to be fixed.