From 48a51628b841a9b69db846326dcaa67239a8559f Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 1 Nov 2026 22:10:48 +0100 Subject: Fix generic inference for a procedure call as a slice base --- include/elna/boot/symbol.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/elna/boot/symbol.h b/include/elna/boot/symbol.h index c9ba88a..f9905c1 100644 --- a/include/elna/boot/symbol.h +++ b/include/elna/boot/symbol.h @@ -761,6 +761,22 @@ namespace elna::boot type substitute(const type& subject, const std::vector& parameters, const std::vector& arguments); + /** + * Walks a declared parameter type and an actual argument type in parallel, + * binding a parameter the first time it is met and leaving every later + * occurrence to the ordinary assignability check. Both sides are resolved + * at every step, so a transparent instantiation is seen through and only a + * record-referent one is compared as an instantiation. + * + * \param parameters Type parameters of the generic procedure. + * \param bindings Bound type arguments, indexed like \p parameters. + * \param declared Declared parameter type. + * \param actual Actual argument type. + * \return Whether the declared and actual types match in shape. + */ + bool bind_arguments(const std::vector& parameters, std::vector& bindings, + const type& declared, const type& actual); + /** * Resolves a type to the view layout and codegen see, in which an * instantiation is its generic's referent with the arguments dropped. -- cgit v1.2.3