mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Print able type variables correctly
This commit is contained in:
parent
154b17d9f0
commit
b3845c21bd
3 changed files with 35 additions and 8 deletions
|
@ -1958,6 +1958,8 @@ fn type_to_variable<'a>(
|
|||
let copy_var = match opt_ability {
|
||||
None => helper!(typ),
|
||||
Some(ability) => {
|
||||
// If this type argument is marked as being bound to an ability, we must
|
||||
// now correctly instantiate it as so.
|
||||
match RegisterVariable::from_type(subs, rank, pools, arena, typ) {
|
||||
RegisterVariable::Direct(var) => {
|
||||
use Content::*;
|
||||
|
@ -1968,13 +1970,6 @@ fn type_to_variable<'a>(
|
|||
var,
|
||||
FlexAbleVar(Some(name), *ability),
|
||||
),
|
||||
RigidAbleVar(name, existing_ability) => {
|
||||
debug_assert_eq!(existing_ability, *ability);
|
||||
subs.set_content(
|
||||
var,
|
||||
FlexAbleVar(Some(name), existing_ability),
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
// TODO associate the type to the bound ability, and check
|
||||
// that it correctly implements the ability.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue