mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 17:42:41 +00:00
### Description Fixes an issue where the toolchain accepted abstract types in function parameters declared with `var`. ### Changes - Implemented a check for abstract types for function parameters with `var` binding pattern in `HandleAnyBindingPattern`. - Added a test case to `toolchain/check/testdata/class/fail_abstract.carbon`. **Note:** I did not use `AsConcreteType` like used in `case FullPatternStack::Kind::NameBindingDecl`. Using it enforces type completion, thus causing valid signatures such as `fn F[var self: Self]` to fail. Also the pre-commit checks fail due to a diagnostic name collision with `toolchain/check/type_completion.cpp`. Should I add a function that just checks if the type is abstract to share the diagnostic? Fixes #6402