diff --git a/repl/src/repl.rs b/repl/src/repl.rs index 870ed125a2..32eb51ccb0 100644 --- a/repl/src/repl.rs +++ b/repl/src/repl.rs @@ -396,10 +396,11 @@ fn set_globals( }); let field_type = resolved_type .row_iter() - .find(|f| f.name == *field_name) + .find(|f| f.name.name_eq(field_name)) .unwrap_or_else(|| { panic!( - "record type doesn't have field `{}`", + "record type `{}` doesn't have field `{}`", + resolved_type, field_name.declared_name() ) }) diff --git a/repl/tests/rexpect.rs b/repl/tests/rexpect.rs index 1f07654b02..305e2ea291 100644 --- a/repl/tests/rexpect.rs +++ b/repl/tests/rexpect.rs @@ -157,3 +157,10 @@ fn error_reports_correct_line() { repl.test("let { x } = {}", Some("let { x } = {}")); } + +#[test] +fn import() { + let mut repl = REPL::new(); + + repl.test("let { assert } = import! std.test", None); +}