Skip to content

Commit

Permalink
fix(repl): Extract record fields using name_eq instead of Symbol::eq
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Jul 31, 2018
1 parent 80b085a commit 160c1c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions repl/src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
})
Expand Down
7 changes: 7 additions & 0 deletions repl/tests/rexpect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 160c1c9

Please sign in to comment.