[Mono-bugs] [Bug 613708] New: TreeNode Clone() doesn't return a type of the original instance for derived classes.
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Jun 11 15:57:28 EDT 2010
http://bugzilla.novell.com/show_bug.cgi?id=613708
http://bugzilla.novell.com/show_bug.cgi?id=613708#c0
Summary: TreeNode Clone() doesn't return a type of the original
instance for derived classes.
Classification: Mono
Product: Mono: Class Libraries
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Windows.Forms
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: tom_hindle at sil.org
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
Created an attachment (id=368764)
--> (http://bugzilla.novell.com/attachment.cgi?id=368764)
Test case showing mono .NET difference
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5
(KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5
On .NET calling (the non static method) TreeNode.Clone() returns a object -
which (runtime) type is the same time as the derived class.
IE for class MyTreeNode:
class MyTreeNode : TreeNode {}
var n = new MyTreeNode();
n.Clone().GetType() would equal MyTreeNode on .NET but equals TreeNode on mono.
Reproducible: Always
Steps to Reproduce:
1. Compile and run attached test case.
Actual Results:
CloneTest.MainClass+MyTreeNode
System.Windows.Forms.TreeNode
Expected Results:
CloneTest.MainClass+MyTreeNode
CloneTest.MainClass+MyTreeNode
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list