Bug 41602 - Compiler fails to recognize Indexer
Summary: Compiler fails to recognize Indexer
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
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)

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

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

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