[MonoDevelop] Trouble with type conversions

"Andrés G. Aragoneses" knocte at gmail.com
Wed Dec 17 21:10:15 EST 2008


Wolfgang Schulze-Zachau wrote:
> Hi all,
> 
> I am using MD 2 Alpha 2, compiled from source under Fedora 9. Have to
> run it as root, but otherwise it works fine, except for the following
> problem:
> This code:
> <snip>
> 27		[Test()]
> 28		public void Instantiation()
> 29		{
> 30			IProjectData nd = provider.getNewNodeData();
> 31			node = new ProjectNode((Amino.Common.IProjectData)nd);
> 32			Assert.AreEqual(0, node.WorkTypeID, "wrong worktype ID
> instantiated");
> 33			Assert.AreEqual(0, node.ParentID, "wrong parent ID instantiated");
> 34			Assert.AreEqual(ProjectNodeType.Project, node.NodeType, "wrong type
> instantiated");
> 35		}
> </snip>
> 
> gives me the following errors:
> 
> /home/wsz/projects/mono/ProCosta/testProCosta/TestProjectNode.cs(31,32):
> error CS1502: The best overloaded method match for
> `Amino.Project.ProjectNode.ProjectNode(Amino.Common.IProjectData)' has
> some invalid arguments
> /home/wsz/projects/mono/ProCosta/libAProject/bin/Debug/Amino.Project.dll
> (Location of the symbol related to previous error)
> /home/wsz/projects/mono/ProCosta/testProCosta/TestProjectNode.cs(31,32):
> error CS1503: Argument `#1' cannot convert `Amino.Common.IProjectData'
> expression to type `Amino.Common.IProjectData'
> /home/wsz/projects/mono/ProCosta/testProCosta/TestProjectNode.cs(31,32):
> (equally named types possibly from different assemblies in previous
> error)
> /home/wsz/projects/mono/ProCosta/libABase/bin/Debug/Amino.Common.dll
> (Location of the symbol related to previous error)
> /home/wsz/projects/mono/ProCosta/libAProject/bin/Debug/Amino.Common.dll
> (Location of the symbol related to previous error)
> 
> The strange thing is: there is no other named type from a different
> assembly!. And all relevant code defines the correct interface as the
> type. It get's even funnier: when I play around with various other bits
> of code, the error sometimes goes away (unpredictably) and then returns
> (also unpredictably).
> Any pointers in this direction would be highly appreciated. I am also
> more than happy to provide all necessary source code for this.
> 
> best regards
> Wolfgang

This seems to be a gmcs problem so I would recommend you to write to
mono-devel list, and of course giving more information (version of Mono
you're using, distro, etc...). And if you can isolate a testcase that at
least sometimes exposes the issue, just file it on bugzilla.novell.com.

Regards,

	Andrés

-- 



More information about the Monodevelop-list mailing list