Remove Unified BadType

This commit is contained in:
Ayaz Hafiz 2022-11-08 13:40:30 -06:00
parent 09748aec48
commit fb643758bb
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 3 additions and 54 deletions

View file

@ -91,7 +91,7 @@ impl Env<'_> {
internal_error!("Did not expect derivers to need to specialize unspecialized lambda sets, but we got some: {:?}", lambda_sets_to_specialize)
}
}
Unified::Failure(..) | Unified::BadType(..) => {
Unified::Failure(..) => {
internal_error!("Unification failed in deriver - that's a deriver bug!")
}
}
@ -156,7 +156,7 @@ impl Env<'_> {
}
specialization_lsets
}
Unified::Failure(..) | Unified::BadType(..) => {
Unified::Failure(..) => {
internal_error!("Unification failed in deriver - that's a deriver bug!")
}
}

View file

@ -401,6 +401,6 @@ pub fn unify(
Ok(extra_metadata.changed)
}
Unified::Failure(..) | Unified::BadType(..) => Err(UnificationFailed),
Unified::Failure(..) => Err(UnificationFailed),
}
}

View file

@ -943,13 +943,6 @@ fn solve(
problems.push(problem);
state
}
BadType(vars, problem) => {
introduce(subs, rank, pools, &vars);
problems.push(TypeError::BadType(problem));
state
}
}
@ -1067,13 +1060,6 @@ fn solve(
problems.push(problem);
state
}
BadType(vars, problem) => {
introduce(subs, rank, pools, &vars);
problems.push(TypeError::BadType(problem));
state
}
}
@ -1181,13 +1167,6 @@ fn solve(
problems.push(problem);
state
}
BadType(vars, problem) => {
introduce(subs, rank, pools, &vars);
problems.push(TypeError::BadType(problem));
state
}
}
@ -1401,13 +1380,6 @@ fn solve(
);
problems.push(problem);
state
}
BadType(vars, problem) => {
introduce(subs, rank, pools, &vars);
problems.push(TypeError::BadType(problem));
state
}
}
@ -1609,15 +1581,6 @@ fn solve(
}
}
}
BadType(vars, problem) => {
subs.commit_snapshot(snapshot);
introduce(subs, rank, pools, &vars);
problems.push(TypeError::BadType(problem));
should_check_exhaustiveness = false;
}
}
let sketched_rows = constraints.sketched_rows[sketched_rows.index()].clone();
@ -2099,14 +2062,6 @@ fn check_ability_specialization(
problems.push(problem);
Err(())
}
BadType(vars, problem) => {
subs.commit_snapshot(snapshot);
introduce(subs, rank, pools, &vars);
problems.push(TypeError::BadType(problem));
Err(())
}
};
@ -3046,11 +3001,6 @@ fn type_to_variable<'a>(
problems.push(problem);
}
BadType(_vars, problem) => {
// No introduction needed
problems.push(TypeError::BadType(problem));
}
}
}
}

View file

@ -225,7 +225,6 @@ pub enum Unified<M: MetaCollector = NoCollector> {
extra_metadata: M,
},
Failure(Pool, ErrorType, ErrorType, DoesNotImplementAbility),
BadType(Pool, roc_types::types::Problem),
}
impl<M: MetaCollector> Unified<M> {