[Mono-list] MCS Bug?
Patrik Torstensson
totte@labs2.com
Sun, 14 Apr 2002 02:37:29 +0200
This is a multi-part message in MIME format.
------_=_NextPart_001_01C1E34C.8EA347F9
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
The following code failes:
using System;
class Test {
public static void Main(String[] args) {
long iTest =3D 1;
System.Threading.Interlocked.Increment(ref iTest);
}
}
With the following error:
(process:7397): ** WARNING **: unhandled exception
System.InvalidCastException: "Cannot cast from source type to
destination type"
in Mono.CSharp.Argument:Emit ()
in Mono.CSharp.Invocation:EmitArguments ()
in Mono.CSharp.Invocation:EmitCall ()
in Mono.CSharp.Invocation:Emit ()
in Mono.CSharp.Invocation:EmitStatement ()
in Mono.CSharp.StatementExpression:Emit ()
in Mono.CSharp.Block:Emit ()
in Mono.CSharp.EmitContext:EmitTopBlock ()
in Mono.CSharp.Method:Emit ()
in Mono.CSharp.TypeContainer:Emit ()
in Mono.CSharp.RootContext:EmitCode ()
in Mono.CSharp.Driver:MainDriver ()
in Mono.CSharp.Driver:Main ()
I did think that it was my icalls but they are removed (lates corlib and
mcs)
Any hints?=20
If I make a new class with two static methods with the same signatures
it works....
- Patrik
------_=_NextPart_001_01C1E34C.8EA347F9
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.5762.3">
<TITLE>MCS Bug?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=3D2 FACE=3D"Verdana">The following code failes:</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">using System;</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">class Test {</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Verdana"> public =
static void Main(String[] args) {</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Verdana"> &n=
bsp; long iTest =3D 1;</FONT>
</P>
<P><FONT SIZE=3D2 =
FACE=3D"Verdana"> &n=
bsp; =
System.Threading.Interlocked.Increment(ref iTest);</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Verdana"> }</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">}</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">With the following error:</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">(process:7397): ** WARNING **: =
unhandled exception System.InvalidCastException: "Cannot cast from =
source type to destination type"</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Argument:Emit =
()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in =
Mono.CSharp.Invocation:EmitArguments ()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Invocation:EmitCall =
()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Invocation:Emit =
()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in =
Mono.CSharp.Invocation:EmitStatement ()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in =
Mono.CSharp.StatementExpression:Emit ()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Block:Emit ()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in =
Mono.CSharp.EmitContext:EmitTopBlock ()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Method:Emit ()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.TypeContainer:Emit =
()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.RootContext:EmitCode =
()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Driver:MainDriver =
()</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">in Mono.CSharp.Driver:Main ()</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">I did think that it was my icalls but =
they are removed (lates corlib and mcs)</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">Any hints? </FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">If I make a new class with two static =
methods with the same signatures it works....</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">- Patrik</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C1E34C.8EA347F9--