Formatting.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use super::ast as ir;
|
||||
use super::ast::Type;
|
||||
use crate::eval::PrimitiveType;
|
||||
use crate::type_infer::solve::Constraint;
|
||||
use crate::syntax::{self, ConstantType};
|
||||
use crate::type_infer::solve::Constraint;
|
||||
use internment::ArcIntern;
|
||||
use std::collections::HashMap;
|
||||
use std::str::FromStr;
|
||||
@@ -112,7 +112,10 @@ fn convert_expression(
|
||||
let newtype = ir::gentype();
|
||||
let newval = ir::Value::Unknown(base, value);
|
||||
|
||||
constraint_db.push(Constraint::ConstantNumericType(loc.clone(), newtype.clone()));
|
||||
constraint_db.push(Constraint::ConstantNumericType(
|
||||
loc.clone(),
|
||||
newtype.clone(),
|
||||
));
|
||||
(newval, newtype)
|
||||
}
|
||||
Some(ConstantType::U8) => (
|
||||
|
||||
@@ -373,10 +373,13 @@ pub fn solve_constraints(
|
||||
// we try to advance it to a primitive
|
||||
Constraint::ConstantNumericType(loc, Type::Variable(vloc, var)) => {
|
||||
match resolutions.get(&var) {
|
||||
None => constraint_db
|
||||
.push(Constraint::ConstantNumericType(loc, Type::Variable(vloc, var))),
|
||||
None => constraint_db.push(Constraint::ConstantNumericType(
|
||||
loc,
|
||||
Type::Variable(vloc, var),
|
||||
)),
|
||||
Some(nt) => {
|
||||
constraint_db.push(Constraint::ConstantNumericType(loc, Type::Primitive(*nt)));
|
||||
constraint_db
|
||||
.push(Constraint::ConstantNumericType(loc, Type::Primitive(*nt)));
|
||||
changed_something = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user