예제 #1
0
 private static Type GetArgumentType(object argument)
 {
     if (argument == null)
     {
         return(typeof(LanguagePrimitives.Null));
     }
     return(argument is PSReference psReference?Adapter.GetArgumentType(psReference.Value) : argument.GetType());
 }
예제 #2
0
        internal static ConversionRank GetArgumentConversionRank(
            object argument,
            Type parameterType)
        {
            ConversionRank conversionRank = LanguagePrimitives.GetConversionRank(Adapter.GetArgumentType(argument), parameterType);

            if (conversionRank == ConversionRank.None)
            {
                conversionRank = LanguagePrimitives.GetConversionRank(Adapter.GetArgumentType(PSObject.Base(argument)), parameterType);
            }
            return(conversionRank);
        }