1.1 --- a/templates/ops.c Fri Nov 25 00:53:22 2016 +0100
1.2 +++ b/templates/ops.c Fri Nov 25 12:46:35 2016 +0100
1.3 @@ -139,13 +139,19 @@
1.4
1.5 if (__is_instance(attr.context))
1.6 return attr;
1.7 - if (__is_instance(context) && __test_common_instance(context, __TYPEPOS(attr.context), __TYPECODE(attr.context)))
1.8 - return __replace_context(context, attr);
1.9 - if (!__is_instance(context) && __test_common_type(context, __TYPEPOS(attr.context), __TYPECODE(attr.context)))
1.10 - return __update_context(context, attr);
1.11 +
1.12 + /* Test any instance context against the context employed by the
1.13 + attribute. */
1.14
1.15 - __raise_type_error();
1.16 - return __NULL;
1.17 + if (__is_instance(context))
1.18 + if (__test_common_instance(context, __TYPEPOS(attr.context), __TYPECODE(attr.context)))
1.19 + return __replace_context(context, attr);
1.20 + else
1.21 + __raise_type_error();
1.22 +
1.23 + /* Otherwise, preserve the attribute as retrieved. */
1.24 +
1.25 + return attr;
1.26 }
1.27
1.28 __attr __replace_context(__ref context, __attr attr)