diff --git a/compiler/solve/tests/solve_expr.rs b/compiler/solve/tests/solve_expr.rs index c495f68c5c..63605f8238 100644 --- a/compiler/solve/tests/solve_expr.rs +++ b/compiler/solve/tests/solve_expr.rs @@ -4450,4 +4450,33 @@ mod solve_expr { "Num *", ); } + + #[test] + fn rigid_type_variable_problem() { + // see https://github.com/rtfeldman/roc/issues/1162 + infer_eq_without_problem( + indoc!( + r#" + app "test" provides [ main ] to "./platform" + + RBTree k : [ Node k (RBTree k) (RBTree k), Empty ] + + balance : a, RBTree a -> RBTree a + balance = \key, left -> + when left is + Node _ _ lRight -> + Node key lRight Empty + + _ -> + Empty + + + main : RBTree {} + main = + balance {} Empty + "# + ), + "RBTree {}", + ); + } }