fn infer_literal(raw_literal: &raw::Literal) -> Result<(Literal, RcType), TypeError> {
    match *raw_literal {
        raw::Literal::String(_, ref value) => Ok((
            Literal::String(value.clone()),
            RcValue::from(Value::global("String")),
        )),
        raw::Literal::Char(_, value) => {
            Ok((Literal::Char(value), RcValue::from(Value::global("Char"))))
        },
        raw::Literal::Int(span, _) => Err(TypeError::AmbiguousIntLiteral { span }),
        raw::Literal::Float(span, _) => Err(TypeError::AmbiguousFloatLiteral { span }),
    }
}
/// Synthesize the type of a literal, returning the elaborated literal and the
/// inferred type if successful
Synthesize the type of a literal, returning the elaborated literal and the
inferred type if successful
Synthesize the type of a literal returning the elaborated literal and the inferred type if successful
fn infer_literal(raw_literal: &raw::Literal) -> Result<(Literal, RcType), TypeError> {
    match *raw_literal {
        raw::Literal::String(_, ref value) => Ok((
            Literal::String(value.clone()),
            RcValue::from(Value::global("String")),
        )),
        raw::Literal::Char(_, value) => {
            Ok((Literal::Char(value), RcValue::from(Value::global("Char"))))
        },
        raw::Literal::Int(span, _) => Err(TypeError::AmbiguousIntLiteral { span }),
        raw::Literal::Float(span, _) => Err(TypeError::AmbiguousFloatLiteral { span }),
    }
}
fn infer_literal ( raw_literal : & raw :: Literal ) -> Result < ( Literal , RcType ) , TypeError > { match * raw_literal { raw :: Literal :: String ( _ , ref value ) => Ok ( ( Literal :: String ( value . clone ( ) ) , RcValue :: from ( Value :: global ( " " ) ) , ) ) , raw :: Literal :: Char ( _ , value ) => { Ok ( ( Literal :: Char ( value ) , RcValue :: from ( Value :: global ( " " ) ) ) ) } , raw :: Literal :: Int ( span , _ ) => Err ( TypeError :: AmbiguousIntLiteral { span } ) , raw :: Literal :: Float ( span , _ ) => Err ( TypeError :: AmbiguousFloatLiteral { span } ) , } }
Synthesize the type of a literal, returning the elaborated literal and the
inferred type if successful
Synthesize the type of a literal returning the elaborated literal and the inferred type if successful
raw_literal
&raw::Literal
raw_literal
&raw::Literal