Make sure wrong specializations become error types

This commit is contained in:
Ayaz Hafiz 2022-07-25 12:45:55 -04:00
parent 3703940da9
commit c1dbffdad9
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1785,9 +1785,11 @@ fn check_ability_specialization(
// This def is not specialized for the claimed opaque type, that's an
// error.
// Commit so that `var` persists in subs.
// Commit so that the bad signature and its error persists in subs.
subs.commit_snapshot(snapshot);
let (_typ, _problems) = subs.var_to_error_type(symbol_loc_var.value);
let problem = TypeError::WrongSpecialization {
region: symbol_loc_var.region,
ability_member: impl_key.ability_member,