tfpt review “/shelveset:Conversions12;REDMOND\tomat”
RestrictionInfo is renamed to RestrictedArguments and passed to
ArgBuilder.ToExpression and ArgBuilder.ToDelegate instead of
List. This way the methods have full information on the
meta-arguments as well as their restrictions that were used to resolve
OverloadResolver.ConvertExpression now takes DynamicMetaObject and its
restricted Type. Conversions can directly cast the value to the
restricted type (if visible) instead of testing the type again.
ConversionResult - hold on the argument value as well as its limit type.
We need to report class name in an error message that can only be
retrieved from the actual object not the CLR type.
Adds InstanceBuilder class, removes NullArgBuilder. NullArgBuilder is
handled as a special case in InstanceBuilder. InstanceBuilder first
finds a callable method if the current method info is not and then
converts the instance argument to the declaring type of the method
(could be an interface). It uses limit type of the instance meta
argument to determine the callable method. The limit type could be an
internal type that inherits an implementation of the method from its
super type and exposes it via a public interface. In that case the
declaring type of the method info given to the overload resolver is the
base type yet that type might not implement the interface that exposes
the method in the derived type. Hence we need to use the real type of
the argument to find out the callable interface method in
Fixes a bug in MetaObjectExtensions.Restrict - the method created
meta-objects with a value given meta-objects w/o one.
Removes legacy implementation of conversions (copied long time ago from
Python) and replaces it by a new one. We use 3 narrowing levels for
conversions performed in overload resolution. Implicit static
conversions are considered in level 1, explicit static conversions on
level 2 and dynamic conversions on level 3.
Adds GenericConversionAction that implements dynamic non-protocol
conversion to an arbitrary type.
ClsTypeEmitter: replaces conversions with conversion dynamic site. Adds
dynamic site construction expressions to a list as they are emitted to
IL and at the end, when the type is being finished, combines them all
into a single block expression and emits that into a static method. This
static method is then called from cctor. The approach can also be used
for the other sites initialized in cctor (not included in this