Get things compiling

This commit is contained in:
Richard Feldman 2020-08-26 21:12:44 -04:00
parent 70bef827a7
commit f35e43768a
18 changed files with 541 additions and 253 deletions

View file

@ -1,4 +1,4 @@
use crate::builtins::{empty_list_type, float_literal, int_literal, list_type, str_type};
use crate::builtins::{empty_list_type, float_literal, int_literal, list_type};
use crate::pattern::{constrain_pattern, PatternState};
use roc_can::annotation::IntroducedVariables;
use roc_can::constraint::Constraint::{self, *};
@ -199,7 +199,15 @@ pub fn constrain_expr(
exists(vars, And(cons))
}
Str(_) | BlockStr(_) => Eq(str_type(), expected, Category::Str, region),
Str { interpolations, .. } => {
todo!(
"constrain interpolations in a string literal {:?}",
interpolations
);
// use crate::builtins::{empty_list_type, float_literal, int_literal, list_type, str_type};
// Eq(str_type(), expected, Category::Str, region)
}
List {
elem_var,
loc_elems,

View file

@ -503,14 +503,15 @@ pub fn constrain_expr(
]),
)
}
BlockStr(_) | Str(_) => {
let uniq_type = var_store.fresh();
let inferred = str_type(Bool::variable(uniq_type));
Str { interpolations, .. } => {
todo!("uniq constrain interpolations {:?}", interpolations);
// let uniq_type = var_store.fresh();
// let inferred = str_type(Bool::variable(uniq_type));
exists(
vec![uniq_type],
Eq(inferred, expected, Category::Str, region),
)
// exists(
// vec![uniq_type],
// Eq(inferred, expected, Category::Str, region),
// )
}
EmptyRecord => {
let uniq_type = var_store.fresh();