protected TypeExpr ResolveBaseTypeExpr (Expression e, bool silent, Location loc)
{
TypeResolveEmitContext.loc = loc;
- TypeResolveEmitContext.ContainerType = TypeBuilder;
TypeResolveEmitContext.ResolvingTypeTree = true;
if (this is GenericMethod)
TypeResolveEmitContext.ContainerType = Parent.TypeBuilder;
- else
- TypeResolveEmitContext.ContainerType = TypeBuilder;
-
return e.ResolveAsTypeTerminal (TypeResolveEmitContext);
}
}
}
- type_params [i] = new TypeParameter (Parent, name, constraints, Location);
+ type_params [i] = new TypeParameter (
+ Parent, this, name, constraints, Location);
AddToContainer (type_params [i], name);
}
// Because the MemberCache holds members from this class and all the base classes,
// we can avoid tons of reflection stuff.
//
- public MemberInfo FindMemberToOverride (Type invocationType, string name, Type [] paramTypes, bool is_property)
+ public MemberInfo FindMemberToOverride (Type invocationType, string name, Type [] paramTypes, GenericMethod genericMethod, bool is_property)
{
ArrayList applicable;
if (method_hash != null && !is_property)
if (!TypeManager.IsEqual (paramTypes [j], cmpAttrs [j]))
goto next;
}
-
+
+ //
+ // check generic arguments for methods
+ //
+ if (mi != null) {
+ Type [] cmpGenArgs = mi.GetGenericArguments ();
+ if (genericMethod != null && cmpGenArgs.Length > 0) {
+ if (genericMethod.TypeParameters.Length != cmpGenArgs.Length)
+ goto next;
+ }
+ else if (! (genericMethod == null && cmpGenArgs.Length == 0))
+ goto next;
+ }
+
//
// get one of the methods because this has the visibility info.
//