ran into another type inference problem

This commit is contained in:
2024-02-05 17:30:16 -06:00
parent 7def938781
commit 9d41cf0da7
17 changed files with 267 additions and 24 deletions

View File

@@ -1,5 +1,7 @@
use crate::eval::PrimitiveType;
use crate::ir::{Expression, Primitive, Program, TopLevel, Type, TypeWithVoid, Value, ValueOrRef, Variable};
use crate::ir::{
Expression, Primitive, Program, TopLevel, Type, TypeWithVoid, Value, ValueOrRef, Variable,
};
use crate::syntax::Location;
use crate::util::scoped_map::ScopedMap;
use proptest::strategy::{NewTree, Strategy, ValueTree};
@@ -300,7 +302,8 @@ fn generate_random_expression(
if !next_type.is_void() {
let name = generate_random_name(rng);
env.insert(name.clone(), next_type.clone());
next = Expression::Bind(Location::manufactured(), name, next_type, Box::new(next));
next =
Expression::Bind(Location::manufactured(), name, next_type, Box::new(next));
}
stmts.push(next);
}