private static bool InterceptStringIndexGetter(object target, string funcName, object[] args, out object result)
{
if (target is string && funcName == IndexerGetterName)
{
if (args.Length != 1)
throw ErrorFactory.CreateClrError("Invalid number of indexer arguments");
int index = args[0] is BikeNumber
? (int)((BikeNumber)args[0]).Value
: (int)(decimal)args[0];
result = ((string)target)[index];
return true;
}
result = null;
return false;
}