mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Add test for when specialization types conflict
This commit is contained in:
parent
cf1a6691dd
commit
67b5ab7fe7
2 changed files with 44 additions and 4 deletions
|
@ -1319,10 +1319,8 @@ fn check_ability_specialization(
|
|||
.filter(|mia| mia.ability == root_data.parent_ability)
|
||||
.collect::<Vec<_>>();
|
||||
ability_implementations_for_specialization.dedup();
|
||||
debug_assert_eq!(
|
||||
ability_implementations_for_specialization.len(), 1,
|
||||
"If there's more than one, the definition is ambiguous - this should be an error"
|
||||
);
|
||||
|
||||
debug_assert!(ability_implementations_for_specialization.len() == 1, "Multiple variables bound to an ability - this is ambiguous and should have been caught in canonicalization");
|
||||
|
||||
// This is a valid specialization! Record it.
|
||||
let specialization_type = ability_implementations_for_specialization[0].typ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue