public override bool IsMatch(Type type, OpenTypeMatchContext context) { if (type == null) { throw new ArgumentNullException(nameof(type)); } if (type.IsByRef) { var elementType = type.GetElementType(); return(_inner.IsMatch(elementType, context)); } return(false); }
public override bool IsMatch(Type type, OpenTypeMatchContext context) { if (type == null) { throw new ArgumentNullException(nameof(type)); } if (context == null) { throw new ArgumentNullException(nameof(context)); } if (type.IsGenericType && ExactMatch.TypeEquals(type.GetGenericTypeDefinition(), _outerType)) { var args = type.GetGenericArguments(); return(_inner.IsMatch(args[0], context)); } return(false); }