From a2906995e00e0ae9aafe72d33f329284b83ae26e Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Wed, 6 Jul 2022 12:07:48 -0400 Subject: [PATCH] Replace flex vars with lambda set vars during type_to_var --- crates/compiler/solve/src/solve.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/compiler/solve/src/solve.rs b/crates/compiler/solve/src/solve.rs index c84db2bfd9..96c472e114 100644 --- a/crates/compiler/solve/src/solve.rs +++ b/crates/compiler/solve/src/solve.rs @@ -2452,12 +2452,18 @@ impl AmbientFunctionPolicy { ambient_function, }), Content::FlexVar(_) => { + Content::LambdaSet(LambdaSet { + solved: UnionLabels::default(), + recursion_var: OptVariable::NONE, + unspecialized: SubsSlice::default(), + ambient_function, + }) // Something like // Encoder fmt : List U8, fmt -a-> List U8 | fmt has EncoderFormatting // THEORY: Just allow this, it's fine, because the lambda set is unbound, // but it's not part of an ability signature, so it doesn't have an unspecialized // lambda set, and hence doesn't need a link to the ambient function. - *content + // *content } content => internal_error!("{:?}({:?}) not a lambda set", content, var), };