diff --git a/compiler/can/src/def.rs b/compiler/can/src/def.rs index f5417708fa..54c64f8c92 100644 --- a/compiler/can/src/def.rs +++ b/compiler/can/src/def.rs @@ -1218,7 +1218,9 @@ fn canonicalize_pending_value_def<'a>( } }; - if let Pattern::Identifier(symbol) = loc_can_pattern.value { + if let Pattern::Identifier(symbol) + | Pattern::AbilityMemberSpecialization { ident: symbol, .. } = loc_can_pattern.value + { let def = single_can_def( loc_can_pattern, loc_can_expr, diff --git a/compiler/solve/tests/solve_expr.rs b/compiler/solve/tests/solve_expr.rs index b926ebf467..c781854cfa 100644 --- a/compiler/solve/tests/solve_expr.rs +++ b/compiler/solve/tests/solve_expr.rs @@ -5860,4 +5860,23 @@ mod solve_expr { [("hash", "Id")], ) } + + #[test] + fn ability_checked_specialization_with_annotation_only() { + check_inferred_abilities( + indoc!( + r#" + app "test" provides [ hash ] to "./platform" + + Hash has + hash : a -> U64 | a has Hash + + Id := U64 + + hash : Id -> U64 + "# + ), + [("hash", "Id")], + ) + } }