mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Merge pull request #4825 from roc-lang/i4773
Handle error types in record/tag extensions when printing errors
This commit is contained in:
commit
1abc6d68a2
1 changed files with 8 additions and 0 deletions
|
@ -3967,6 +3967,8 @@ fn flat_type_to_err_type(
|
|||
ErrorType::Record(err_fields, TypeExt::RigidOpen(var))
|
||||
}
|
||||
|
||||
ErrorType::Error => ErrorType::Record(err_fields, TypeExt::Closed),
|
||||
|
||||
other =>
|
||||
panic!("Tried to convert a record extension to an error, but the record extension had the ErrorType of {:?}", other)
|
||||
}
|
||||
|
@ -3991,6 +3993,8 @@ fn flat_type_to_err_type(
|
|||
ErrorType::TagUnion(err_tags, TypeExt::RigidOpen(var), pol)
|
||||
}
|
||||
|
||||
ErrorType::Error => ErrorType::TagUnion(err_tags, TypeExt::Closed, pol),
|
||||
|
||||
other =>
|
||||
panic!("Tried to convert a tag union extension to an error, but the tag union extension had the ErrorType of {:?}", other)
|
||||
}
|
||||
|
@ -4019,6 +4023,8 @@ fn flat_type_to_err_type(
|
|||
ErrorType::TagUnion(err_tags, TypeExt::RigidOpen(var), pol)
|
||||
}
|
||||
|
||||
ErrorType::Error => ErrorType::TagUnion(err_tags, TypeExt::Closed, pol),
|
||||
|
||||
other =>
|
||||
panic!("Tried to convert a tag union extension to an error, but the tag union extension had the ErrorType of {:?}", other)
|
||||
}
|
||||
|
@ -4049,6 +4055,8 @@ fn flat_type_to_err_type(
|
|||
ErrorType::RecursiveTagUnion(rec_error_type, err_tags, TypeExt::RigidOpen(var), pol)
|
||||
}
|
||||
|
||||
ErrorType::Error => ErrorType::RecursiveTagUnion(rec_error_type, err_tags, TypeExt::Closed, pol),
|
||||
|
||||
other =>
|
||||
panic!("Tried to convert a recursive tag union extension to an error, but the tag union extension had the ErrorType of {:?}", other)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue