diff --git a/compiler/mono/src/ir.rs b/compiler/mono/src/ir.rs index c1e212b6e5..2e954f346b 100644 --- a/compiler/mono/src/ir.rs +++ b/compiler/mono/src/ir.rs @@ -2802,6 +2802,16 @@ pub fn with_hole<'a>( use crate::layout::UnionVariant::*; let arena = env.arena; + match layout_cache.from_var(arena, variant_var, env.subs) { + Err(e) => panic!("invalid layout {:?}", e), + Ok(Layout::FunctionPointer(argument_layouts, ret_layout)) => { + dbg!(argument_layouts, ret_layout); + } + Ok(_) => { + panic!("idk") + } + } + let res_variant = crate::layout::union_sorted_tags(env.arena, variant_var, env.subs); let variant = match res_variant { diff --git a/compiler/mono/src/layout.rs b/compiler/mono/src/layout.rs index 975b16d6f9..7cd65a7471 100644 --- a/compiler/mono/src/layout.rs +++ b/compiler/mono/src/layout.rs @@ -1,6 +1,7 @@ use crate::ir::Parens; use bumpalo::collections::Vec; use bumpalo::Bump; +use core::panic; use roc_collections::all::{default_hasher, MutMap, MutSet}; use roc_module::ident::{Lowercase, TagName}; use roc_module::symbol::{Interns, Symbol}; diff --git a/compiler/test_gen/src/gen_list.rs b/compiler/test_gen/src/gen_list.rs index 2ed0c4fbe4..a9cfe5465b 100644 --- a/compiler/test_gen/src/gen_list.rs +++ b/compiler/test_gen/src/gen_list.rs @@ -1803,3 +1803,19 @@ fn cleanup_because_exception() { RocList ); } + +#[test] +fn applied_tag_function() { + assert_evals_to!( + indoc!( + r#" + x : List [ Foo Str ] + x = List.map [ "a", "b" ] Foo + + x + "# + ), + RocList::from_slice(&[false; 1]), + RocList + ); +}