Formatting.

This commit is contained in:
2023-07-22 15:00:07 -07:00
parent f968e20a75
commit 64405d5a06
8 changed files with 70 additions and 57 deletions

View File

@@ -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) => (

View File

@@ -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;
}
}