fix: There was a stack overflow due to passing unbound types to a function

This commit is contained in:
microproofs 2023-09-25 13:05:27 -04:00 committed by Kasey
parent 1cab479b81
commit 534eb62a07
2 changed files with 1 additions and 3 deletions

View File

@ -531,6 +531,7 @@ impl TypeVar {
pub fn get_inner_types(&self) -> Vec<Rc<Type>> { pub fn get_inner_types(&self) -> Vec<Rc<Type>> {
match self { match self {
Self::Link { tipo } => tipo.get_inner_types(), Self::Link { tipo } => tipo.get_inner_types(),
Self::Unbound { .. } => vec![],
var => { var => {
vec![Type::Var { vec![Type::Var {
tipo: RefCell::new(var.clone()).into(), tipo: RefCell::new(var.clone()).into(),

View File

@ -18,8 +18,5 @@ fn sum_list(list: List<Schema>) -> Int {
} }
test foo() { test foo() {
// False
// Can't enable the "real" test because it puts the UPLC evaluator in an infinite loop.
// -
sum(List([List([Integer(1), Integer(2)]), Integer(3), Integer(4)])) == 10 sum(List([List([Integer(1), Integer(2)]), Integer(3), Integer(4)])) == 10
} }