mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Add a uitest for pseudo-polymorphic specializations
This commit is contained in:
parent
19c0ebc10f
commit
32d4b45557
2 changed files with 19 additions and 1 deletions
|
@ -20,7 +20,7 @@ use roc_reporting::report::{can_problem, type_problem, RocDocAllocator};
|
|||
use roc_solve_problem::TypeError;
|
||||
use roc_types::{
|
||||
pretty_print::{name_and_print_var, DebugPrint},
|
||||
subs::{Subs, Variable},
|
||||
subs::{instantiate_rigids, Subs, Variable},
|
||||
};
|
||||
|
||||
fn promote_expr_to_module(src: &str) -> String {
|
||||
|
@ -533,6 +533,7 @@ impl<'a> QueryCtx<'a> {
|
|||
let def_region = Region::new(start_pos, end_pos);
|
||||
let def_source = &self.source[start_pos.offset as usize..end_pos.offset as usize];
|
||||
|
||||
instantiate_rigids(self.subs, def.var());
|
||||
roc_late_solve::unify(
|
||||
self.home,
|
||||
self.arena,
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
app "test" provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
foo : a, Bool -> Str
|
||||
foo = \in, b -> if b then "done" else bar in
|
||||
# ^^^ a -[[bar(2)]]-> Str
|
||||
# ^^^ a, Bool -[[foo(1)]]-> Str
|
||||
|
||||
bar = \_ -> foo {} Bool.true
|
||||
# ^^^ {}, Bool -[[]]-> Str
|
||||
|
||||
foo "" Bool.false
|
||||
# ^^^{inst} Str, Bool -[[foo(1)]]-> Str
|
||||
# │ foo : a, Bool -> Str
|
||||
# │ foo = \in, b -> if b then "done" else bar in
|
||||
# │ ^^^ Str -[[bar(2)]]-> Str
|
||||
# │ ^^^ Str, Bool -[[foo(1)]]-> Str
|
Loading…
Add table
Add a link
Reference in a new issue