Merge pull request #1610 from rtfeldman/captured-symbols-layout-error

Captured symbols layout error
This commit is contained in:
Richard Feldman 2021-08-20 23:22:54 -04:00 committed by GitHub
commit 349b799d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -4684,14 +4684,16 @@ pub fn from_can<'a>(
);
CapturedSymbols::None
}
Err(e) => {
debug_assert!(
captured_symbols.is_empty(),
"{:?}, {:?}",
&captured_symbols,
e
);
Err(_) => {
// just allow this. see https://github.com/rtfeldman/roc/issues/1585
if captured_symbols.is_empty() {
CapturedSymbols::None
} else {
let mut temp =
Vec::from_iter_in(captured_symbols, env.arena);
temp.sort();
CapturedSymbols::Captured(temp.into_bump_slice())
}
}
};

View File

@ -2712,7 +2712,6 @@ fn int_literal_not_specialized() {
}
#[test]
#[ignore]
fn unresolved_tvar_when_capture_is_unused() {
// see https://github.com/rtfeldman/roc/issues/1585
assert_evals_to!(
@ -2725,8 +2724,7 @@ fn unresolved_tvar_when_capture_is_unused() {
r : Bool
r = False
# underscore does not change the problem, maybe it's type-related? We don 't really know what `Green` refers to below
p1 = (\x -> r == (1 == 1))
p1 = (\_ -> r == (1 == 1))
oneOfResult = List.map [p1] (\p -> p Green)
when oneOfResult is