dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #9851] type-resolving at runtime not always corr


From: anonymous
Subject: [Pnet-developers] [bugs #9851] type-resolving at runtime not always correct
User-agent: Mozilla/5.0 (compatible; Konqueror/3.2; Linux) (KHTML, like Gecko)

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.




/**************************************************************************/
[bugs #9851] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=9851>
Project: DotGNU Portable.NET
Submitted by: 0
On: Mon 08/02/2004 at 15:37

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  None
Assigned to:  None
Status:  Open


Summary:  type-resolving at runtime not always correct

Original Submission:  
Working on a little project, I encountered the following
misbehaviour of pnet (most probably ilrun):

I have a reference of an interface type, which I pass
around through some events and methods.
And at some point in the code I want to cast it back
to a class type. But the "is" operator doesn't return
true for the class and casting without checking
throws an exception.
The class overrides the ToString() method, so I can check
that the object is really an instance of this class, and
just before trying to cast, the right ToString() method
is invoked.

The method which tries to cast looks something like:

public void DoSomething(IBlabla obj)
{
        // ToString() of class SomeClass is invoked
        Console.WriteLine(obj);
        if(obj is SomeClass)
        {
                // This block is never executed...
                //  strange but true
                Console.WriteLine("obj is of type SomeClass");
        }
}

Sorry, but I couldn't track it down to a simple test.











For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=9851>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]