This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
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)

See Also:
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

Note You need to log in before you can comment on or make changes to this bug.