Example #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));
        }
Example #2
0
		public override ResolveResult Resolve(CSharpResolver resolver)
		{
			return resolver.ResolveCast(targetType.Resolve(resolver.Context), expression.Resolve(resolver));
		}
Example #3
0
 public override ResolveResult Resolve(CSharpResolver resolver)
 {
     return(resolver.ResolveCast(targetType.Resolve(resolver.CurrentTypeResolveContext), expression.Resolve(resolver)));
 }