[MonoDevelop] Parser and code completion

Lluis Sanchez lluis at ximian.com
Sun Jun 11 15:53:46 EDT 2006


El dg 11 de 06 del 2006 a les 21:09 +0200, en/na Alejandro Serrano va
escriure:
> Lluis Sanchez escribió:
> >> Firstly:
> >>         It seems to me that fixing the 'Parser' part will not be a big
> >>         problem. The following code should be added:
> >>         in IClass:
> >>         StringCollection GenericParameters {
> >>             get;
> >>         }
> >>     
> >
> > What about type constraints? We should also have this information.
> >   
> >   
> >>         
> >>         in IMethod:
> >>         StringCollection GenericParameters {
> >>             get;
> >>         }
> >>         
> >>         in IReturnType:
> >>         StringCollection GenericArguments {
> >>             get;
> >>         }
> >>     
> >
> > Shouldn't this return a collection of IReturnType?
> >
> >   
> >>         
> >>         in IParameter:
> >>         StringCollection GenericArguments {
> >>             get;
> >>         }
> >>     
> >
> > I'm also wondering if IClass.BaseTypes should now be a list of
> > IReturnType instead of a list of String, since base types can now have
> > generic arguments.
> >   
> My opinion is that ReturnType should continue having just a string, 
> instead of generic arguments. That is because, when you have:
> 
> class Example<T>
> {
>     public T AGenericMethod () { ... }
> }
> 
> You still need to save the ReturnType as the string "T".

In this case T is not a generic argument (I guess you mean T in the
AGenericMethod method), so the ReturnType would have "T" as name, and
nothing in the GenericArguments list.

> So, or we rework everything to work as in Reflection (IClass has a 
> IsGenericArgument property, ReturnType has a class instead of a string, 
> GenericParameters is a list of types with IsGenericArgument == true...) 
> or we just use a string in ReturnType (I'm using it in Nemerle binding 
> and I've found it enough).
> Using a Reflection-like system would be better because it allows 
> constraints, 

There are many ways of storing constraint information. The reflection
model is not needed for this.

> and open and closed generic types are done the same way.

Using the reflection model might be better in some way, but we are not
going to do this change since we would need to rewrite a LOT of code.

Lluis.




More information about the Monodevelop-list mailing list