diff --git a/src/core/PocomathInstance.mjs b/src/core/PocomathInstance.mjs index 0a589ca..62c6757 100644 --- a/src/core/PocomathInstance.mjs +++ b/src/core/PocomathInstance.mjs @@ -404,7 +404,21 @@ export default class PocomathInstance { Object.defineProperty(this, name, {configurable: true, value: 'limbo'}) const tf_imps = {} for (const [rawSignature, behavior] of usableEntries) { - /* For now, replace theTemplateParam with 'any' */ + /* Check if it's an ordinary non-template signature */ + let explicit = true + for (const type of typesOfSignature(rawSignature)) { + if (this._templateParam(type)) { // template types need better check + explicit = false + break + } + } + if (explicit) { + this._addTFimplementation( + tf_imps, rawSignature, behavior.uses, behavior.does) + continue + } + /* It's a template, have to instantiate */ + /* But just for initial testing, punt and use T as synonym for 'any' */ const signature = rawSignature.replaceAll(theTemplateParam, 'any') this._addTFimplementation( tf_imps, signature, behavior.uses, behavior.does)