mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
The first ability... compiles
This commit is contained in:
parent
6b4294307f
commit
b79b351136
7 changed files with 104 additions and 12 deletions
|
@ -140,6 +140,18 @@ pub enum Unified {
|
|||
BadType(Pool, roc_types::types::Problem),
|
||||
}
|
||||
|
||||
impl Unified {
|
||||
pub fn expect_success(self, err_msg: &'static str) -> (Pool, Vec<MustImplementAbility>) {
|
||||
match self {
|
||||
Unified::Success {
|
||||
vars,
|
||||
must_implement_ability,
|
||||
} => (vars, must_implement_ability),
|
||||
_ => panic!("{}", err_msg),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Specifies that `type` must implement the ability `ability`.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct MustImplementAbility {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue