diff --git a/compiler/can/tests/test_can.rs b/compiler/can/tests/test_can.rs index 49ee90ade6..00014c9ce8 100644 --- a/compiler/can/tests/test_can.rs +++ b/compiler/can/tests/test_can.rs @@ -967,6 +967,21 @@ mod test_can { } } + #[test] + fn dict() { + let src = indoc!( + r#" + x = Dict.empty + + Dict.len x + "# + ); + let arena = Bump::new(); + let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src); + + assert_eq!(problems, Vec::new()); + } + #[test] fn unused_def_regression() { let src = indoc!( diff --git a/compiler/load/src/file.rs b/compiler/load/src/file.rs index 3c8a497f29..5d58c357e4 100644 --- a/compiler/load/src/file.rs +++ b/compiler/load/src/file.rs @@ -1264,6 +1264,7 @@ where .stack_size(EXPANDED_STACK_SIZE) .spawn(move |_| { // Keep listening until we receive a Shutdown msg + for msg in worker_msg_rx.iter() { match msg { WorkerMsg::Shutdown => { diff --git a/compiler/mono/tests/test_mono.rs b/compiler/mono/tests/test_mono.rs index b5a924a984..29275c6876 100644 --- a/compiler/mono/tests/test_mono.rs +++ b/compiler/mono/tests/test_mono.rs @@ -55,6 +55,7 @@ mod test_mono { } let exposed_types = MutMap::default(); + let loaded = roc_load::file::load_and_monomorphize_from_str( arena, filename, @@ -633,6 +634,34 @@ mod test_mono { ) } + #[test] + fn dict() { + compiles_to_ir( + r#" + Dict.len Dict.empty + "#, + indoc!( + r#" + procedure List.5 (#Attr.2, #Attr.3): + let Test.7 = lowlevel ListAppend #Attr.2 #Attr.3; + ret Test.7; + + procedure Test.1 (Test.2): + let Test.6 = 42i64; + let Test.5 = CallByName List.5 Test.2 Test.6; + ret Test.5; + + procedure Test.0 (): + let Test.8 = 1i64; + let Test.9 = 2i64; + let Test.4 = Array [Test.8, Test.9]; + let Test.3 = CallByName Test.1 Test.4; + ret Test.3; + "# + ), + ) + } + #[test] fn list_append_closure() { compiles_to_ir(