X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fgmcs%2Fexpression.cs;h=3985cd5818cf8a0f8661dba3622bf71368784743;hb=38f320d19a29a3e7d6a92cdb0b3ebec149d7c1a7;hp=79eb6c8dd79efc52e7fbbbef3cd6602ce6fa21b8;hpb=bb8d28a9eda0bb027105a2f6c9a698d1432bf34d;p=mono.git diff --git a/mcs/gmcs/expression.cs b/mcs/gmcs/expression.cs index 79eb6c8dd79..3985cd5818c 100644 --- a/mcs/gmcs/expression.cs +++ b/mcs/gmcs/expression.cs @@ -8115,6 +8115,21 @@ namespace Mono.CSharp { { Indexers ix = empty; + if (lookup_type.IsGenericParameter) { + GenericConstraints gc = TypeManager.GetTypeParameterConstraints (lookup_type); + if (gc == null) + return empty; + + if (gc.HasClassConstraint) + Append (ref ix, caller_type, GetIndexersForTypeOrInterface (caller_type, gc.ClassConstraint)); + + Type[] ifaces = gc.InterfaceConstraints; + foreach (Type itype in ifaces) + Append (ref ix, caller_type, GetIndexersForTypeOrInterface (caller_type, itype)); + + return ix; + } + Type copy = lookup_type; while (copy != TypeManager.object_type && copy != null){ Append (ref ix, caller_type, GetIndexersForTypeOrInterface (caller_type, copy));