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