[Mono-dev] parametric types and nested classes

Marek Safar marek.safar at seznam.cz
Thu Apr 3 11:50:10 EDT 2008

Hello Robert,
> Hi, I'm having some casting problems with nested classes of classes 
> derived from parametric types. My peeks at the archives have failed to 
> turn anything up. The problem is described below.  It compiles and 
> works as expected in Visual Studio.  Compiling with gmcs gives me 
> these errors:
> mono-gmcs: 1.2.4-6ubuntu6.1
> Foo.cs(23,20): error CS0029: Cannot implicitly convert type `T' to 
> `BarHelper'
> Foo.cs(24,10): error CS0029: Cannot implicitly convert type 
> `Foo<T>.NestedFoo.Property' to `BarHelper'
> Foo.cs(25,13): error CS0030: Cannot convert type `Foo<T>.NestedFoo' to 
> `BarHelper'
> Compilation failed: 3 error(s), 0 warnings
It works correctly with SVN version of gmcs, and I believe it also 
should work with 1.9 (didn't test it though).


More information about the Mono-devel-list mailing list