Address issues found in review

This commit is contained in:
Marcus Klaas de Vries 2019-01-14 21:52:08 +01:00
parent d67eabb512
commit 37ba237e66
3 changed files with 54 additions and 56 deletions

View file

@ -661,22 +661,20 @@ impl ExprCollector {
.map(|s| Name::new(s))
.and_then(|name| UncertainIntTy::from_name(&name));
if let Some(kn) = known_name {
Literal::Int(Default::default(), kn)
} else {
Literal::Int(Default::default(), UncertainIntTy::Unknown)
}
Literal::Int(
Default::default(),
known_name.unwrap_or(UncertainIntTy::Unknown),
)
}
LiteralFlavor::FloatNumber { suffix } => {
let known_name = suffix
.map(|s| Name::new(s))
.and_then(|name| UncertainFloatTy::from_name(&name));
if let Some(kn) = known_name {
Literal::Float(Default::default(), kn)
} else {
Literal::Float(Default::default(), UncertainFloatTy::Unknown)
}
Literal::Float(
Default::default(),
known_name.unwrap_or(UncertainFloatTy::Unknown),
)
}
LiteralFlavor::ByteString => Literal::ByteString(Default::default()),
LiteralFlavor::String => Literal::String(Default::default()),

View file

@ -107,7 +107,7 @@ impl UnifyValue for TypeVarValue {
}
}
/// The kinds of placeholders we need during type inference. There's seperate
/// The kinds of placeholders we need during type inference. There's separate
/// values for general types, and for integer and float variables. The latter
/// two are used for inference of literal values (e.g. `100` could be one of
/// several integer types).