diff --git a/compiler/solve/tests/solve_expr.rs b/compiler/solve/tests/solve_expr.rs index f07ab84355..92c3cf5fc7 100644 --- a/compiler/solve/tests/solve_expr.rs +++ b/compiler/solve/tests/solve_expr.rs @@ -6455,4 +6455,62 @@ mod solve_expr { "Str", ) } + + #[test] + #[ignore] + fn encode_record() { + infer_queries( + indoc!( + r#" + app "test" + imports [ Encode.{ toEncoder } ] + provides [ main ] to "./platform" + + main = toEncoder { a: "" } + # ^^^^^^^^^ + "# + ), + &[], + ) + } + + #[test] + #[ignore] + fn encode_record_with_nested_able_var() { + infer_queries( + indoc!( + r#" + app "test" + imports [ Encode.{ toEncoder, Encoding } ] + provides [ main ] to "./platform" + + main : a -> _ | a has Encoding + main = \a -> toEncoder { a: a } + # ^^^^^^^^^ + "# + ), + &[], + ) + } + + #[test] + #[ignore] + fn encode_record_with_nested_custom_impl() { + infer_queries( + indoc!( + r#" + app "test" + imports [ Encode.{ toEncoder, Encoding, custom } ] + provides [ main ] to "./platform" + + A := {} + toEncoder = \@A _ -> custom \b, _ -> b + + main = toEncoder { a: @A {} } + # ^^^^^^^^^ + "# + ), + &[], + ) + } } diff --git a/reporting/tests/test_reporting.rs b/reporting/tests/test_reporting.rs index 3481321c33..abb913990c 100644 --- a/reporting/tests/test_reporting.rs +++ b/reporting/tests/test_reporting.rs @@ -10053,4 +10053,56 @@ All branches in an `if` must have the same type! ), ) } + + #[test] + #[ignore] + fn function_does_not_implement_encoding() { + new_report_problem_as( + "cycle_through_non_function", + indoc!( + r#" + Encode.toEncoder (\x -> x) + "# + ), + indoc!( + r#" + "# + ), + ) + } + + #[test] + #[ignore] + fn unbound_type_in_record_does_not_implement_encoding() { + new_report_problem_as( + "cycle_through_non_function", + indoc!( + r#" + \x -> Encode.toEncoder { x: x } + "# + ), + indoc!( + r#" + "# + ), + ) + } + + #[test] + #[ignore] + fn nested_opaque_does_not_implement_encoding() { + new_report_problem_as( + "cycle_through_non_function", + indoc!( + r#" + A := {} + Encode.toEncoder { x: @A {} } + "# + ), + indoc!( + r#" + "# + ), + ) + } }