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

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


Attachments
Compiler Test Case (1.91 KB, application/x-zip-compressed)
2016-06-08 15:15 UTC, Jonathan Chambers
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 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:

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

Mono
---------------------------------
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