aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-11-01 22:10:48 +0100
committerEugen Wissner <belka@caraus.de>2026-11-01 22:10:48 +0100
commit48a51628b841a9b69db846326dcaa67239a8559f (patch)
tree76707565b96d42ee652179e4037e42a2c5559888 /include
parent5dd5d460f154c146d26f115706a21b7808658edf (diff)
downloadelna-cpp.tar.gz
Fix generic inference for a procedure call as a slice baseHEADcpp
Diffstat (limited to 'include')
-rw-r--r--include/elna/boot/symbol.h16
1 files changed, 16 insertions, 0 deletions
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
@@ -762,6 +762,22 @@ namespace elna::boot
const std::vector<type>& 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<type>& parameters, std::vector<type>& 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.
*