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 CapturedSymbols::None
} }
Err(e) => { Err(_) => {
debug_assert!( // just allow this. see https://github.com/rtfeldman/roc/issues/1585
captured_symbols.is_empty(), if captured_symbols.is_empty() {
"{:?}, {:?}",
&captured_symbols,
e
);
CapturedSymbols::None 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] #[test]
#[ignore]
fn unresolved_tvar_when_capture_is_unused() { fn unresolved_tvar_when_capture_is_unused() {
// see https://github.com/rtfeldman/roc/issues/1585 // see https://github.com/rtfeldman/roc/issues/1585
assert_evals_to!( assert_evals_to!(
@ -2725,8 +2724,7 @@ fn unresolved_tvar_when_capture_is_unused() {
r : Bool r : Bool
r = False r = False
# underscore does not change the problem, maybe it's type-related? We don 't really know what `Green` refers to below p1 = (\_ -> r == (1 == 1))
p1 = (\x -> r == (1 == 1))
oneOfResult = List.map [p1] (\p -> p Green) oneOfResult = List.map [p1] (\p -> p Green)
when oneOfResult is when oneOfResult is