Bug 529691

Summary: gmcs requires extra type arguments for nested generic types.
Product: [Mono] Mono: Compilers Reporter: Atsushi Enomoto <aenomoto>
Component: C#Assignee: Mono Bugs <mono-bugs>
Status: RESOLVED DUPLICATE QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None    
Version: SVN   
Target Milestone: ---   
Hardware: i586   
OS: Windows XP   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Atsushi Enomoto 2009-08-10 15:09:45 UTC
The following types are simplified version of how Silverlight WCF custom client proxies constitutes, which are based on ClientBase<TChannel> and ChannelBase<T>. 

There is a nested generic type Bar<V> inside a generic type Foo<T>. Then there is a derived type of generic Foo with derived type of Bar as its nested type.

//----------------
public class Foo<T>
{
        protected class Bar<V>
        {
        }
}

public interface IBaz
{
}

public class FooImpl : Foo<IBaz>
{
        private class BarImpl : Bar<IBaz>
        {
        }
}

//------------------

gmcs fails to compile it as:
test.cs(14,33): error CS0305: Using the generic type `Foo<T>.Bar<V>' requires `2' type argument(s)
test.cs(3,25): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings

csc does not result in it.

I know that generic nested types in general requires type arguments for parent types, but in this "derived and nested" case it does not seem to be required.
Comment 1 Andres Aragoneses 2009-08-12 14:33:58 UTC
Dupe.

*** This bug has been marked as a duplicate of bug 324625 ***