[Mono-list] Compilation Error
Mario Sopena Novales
masono1@teleco.upv.es
Mon, 15 Nov 2004 02:53:21 +0100
--=-hAKrHYeJKgAcM/e0+xe+
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hallo!!
When I try to compile a modified version of Monodoc source code, I
get this error:
./browser.cs(257) error CS0019: Operator == cannot be applied to
operands of type `Monodoc.Tabs' and `object'
The code that fails is:
256://Add the Tab
257: if(tabs == null) {
258: tabs = new Tabs(tb);
259:} else {
260: tabs.tabsList.Add(tb);
261:}
I solved the problem doing this:
if((object)tabs == null) {
But I don't know why the compiler can't compile the prior version. The
tabs variable is a reference to an object of type Tabs that inherites
from Notebook. So, where is the problem?
Oh, I should mention that: Mono compiler version 1.1.1.0
Mario.
--=-hAKrHYeJKgAcM/e0+xe+
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.10">
</HEAD>
<BODY>
Hallo!!<BR>
When I try to compile a modified version of Monodoc source code, I get this error:<BR>
<BR>
./browser.cs(257) error CS0019: Operator == cannot be applied to operands of type `Monodoc.Tabs' and `object'<BR>
<BR>
The code that fails is:<BR>
<BR>
256://Add the Tab<BR>
257: if(tabs == null) {<BR>
258: tabs = new Tabs(tb);<BR>
259:} else {<BR>
260: tabs.tabsList.Add(tb);<BR>
261:}<BR>
<BR>
I solved the problem doing this:<BR>
if((object)tabs == null) {<BR>
<BR>
But I don't know why the compiler can't compile the prior version. The tabs variable is a reference to an object of type Tabs that inherites from Notebook. So, where is the problem?<BR>
<BR>
Oh, I should mention that: Mono compiler version 1.1.1.0<BR>
<BR>
Mario.<BR>
<BR>
</BODY>
</HTML>
--=-hAKrHYeJKgAcM/e0+xe+--