Bug 23746 - dmcs in 3.10 fails with CS1525 when using a conditional expression providing a multidimensional array as a function parameter
Summary: dmcs in 3.10 fails with CS1525 when using a conditional expression providing ...
Status: RESOLVED DUPLICATE of bug 23319
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-10-10 16:05 UTC by mz
Modified: 2014-10-13 05:56 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 DUPLICATE of bug 23319

Description mz 2014-10-10 16:05:00 UTC
Compiling the following code raises errors in 3.10:
bug.cs(8,15): error CS1525: Unexpected symbol `?'
bug.cs(8,23): error CS1525: Unexpected symbol `]'

static class Foo
{
  static void Bar(string a, string b) {}

  public static void Main()
  {
    var a = new string[1, 2] { {"a","b"} };
    Bar(1 == 2 ? a[0, 1] : a[0, 0], "foo");
  }
}

For the code to be useble one has to put array references in parentheses.
The code used to work in 3.6
Comment 1 Marek Safar 2014-10-13 05:56:25 UTC

*** This bug has been marked as a duplicate of bug 23319 ***