[Mono-list] mcs, indexer property and errors cs0654 and cs0131

Francisco Jr. fxjrlists@yahoo.com.br
Wed, 29 May 2002 21:14:02 -0300 (ART)

Hi all, I'd like you test the code below to see if you
get the same results as me.

using System;
using System.Collections;

public class Testmcs : ArrayList
	public static void Main(String[] args)
		Testmcs al = new Testmcs();

	public void Test()

	public void Test2()
		base[0] = "World";

In the Test() method, mcs gives me a cs0654 error

cs0654.cs(20) error CS0654: Method
`System.Collections.ArrayList.get_Item()' is
referenced without parentheses

in Test2(): 

cs0654.cs(26) error CS0131: Left hand of an assignment
must be a variable, a property or an indexer.

First, I'm sorry for showing two errors in a single
file. It is because I didn't want to fullfill the
message with two files almost identical.

Now, some observations...

If I change the lines with error from:

Console.WriteLine(base[0]); to:


base[0] = "World"; to 
base.set_Item(0, "World");

mcs compiles it perfectly and it works!

I tested the code with mcs and it works.
I'm using the mono runtime from mono.baselabs.org rpm
date 20020524 on a Linux Mandrake.


Francisco Jr.

Yahoo! Encontros
O lugar certo para vocÍ encontrar aquela pessoa que falta na sua vida. Cadastre-se hoje mesmo!