예제 #1
0
        public override ResolveResult Resolve(CSharpResolver resolver)
        {
            var type          = targetType.Resolve(resolver.CurrentTypeResolveContext);
            var resolveResult = expression.Resolve(resolver);

            if (allowNullableConstants && NullableType.IsNullable(type))
            {
                resolveResult = resolver.ResolveCast(NullableType.GetUnderlyingType(type), resolveResult);
                if (resolveResult.IsCompileTimeConstant)
                {
                    return(new ConstantResolveResult(type, resolveResult.ConstantValue));
                }
            }
            return(resolver.ResolveCast(type, resolveResult));
        }
예제 #2
0
		public override ResolveResult Resolve(CSharpResolver resolver)
		{
			return resolver.ResolveCast(targetType.Resolve(resolver.Context), expression.Resolve(resolver));
		}
예제 #3
0
 public override ResolveResult Resolve(CSharpResolver resolver)
 {
     return(resolver.ResolveCast(targetType.Resolve(resolver.CurrentTypeResolveContext), expression.Resolve(resolver)));
 }