Bug 41602 - Compiler fails to recognize Indexer
Summary: Compiler fails to recognize Indexer
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 4.5.X
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2016-06-08 15:15 UTC by Jonathan Chambers
Modified: 2016-06-09 13:06 UTC (History)
2 users (show)

Is this bug a regression?: Yes
Last known good build: Mono 2.6 ;-)

Compiler Test Case (1.91 KB, application/x-zip-compressed)
2016-06-08 15:15 UTC, Jonathan Chambers

Description Jonathan Chambers 2016-06-08 15:15:51 UTC
Created attachment 16232 [details]
Compiler Test Case

Compiler fails to compile code using custom indexer. .Net (csc) compiles this code fine.

Open attached project and try to build:

csc Program.cs -r:IndexerTest.dll
// works correctly

mcs Program.cs -r:IndexerTest.dll
Program.cs(10,23): error CS0021: Cannot apply indexing with [] to an expression of type `TypeWithIndexer'
Compilation failed: 1 error(s), 0 warnings
Comment 1 Marek Safar 2016-06-09 13:06:51 UTC
Fixed in master and 4.5.1

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.

Create a new report for Bug 41602 on Developer Community or GitHub if you have new information to add and do not yet see a matching report.

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

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.

Related Links: