From 87f5a0ed2a86fd25aff89eca611cbbc189fdace0 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Sat, 26 Apr 2025 20:00:08 -0700 Subject: [PATCH] fix: pass strategy into resolve calls --- src/complex/__test__/type.spec.js | 1 + src/core/TypeDispatcher.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/complex/__test__/type.spec.js b/src/complex/__test__/type.spec.js index 2101c74..295d0f3 100644 --- a/src/complex/__test__/type.spec.js +++ b/src/complex/__test__/type.spec.js @@ -51,6 +51,7 @@ describe('complex type operations', () => { assert(math.equal(ccis(Math.PI), cplx(-1))) math.config.returnTyping = ReturnTyping.free assert.strictEqual(math.cis.resolve(NumberT), cis) + assert.strictEqual(math.cis.resolve(NumberT, ReturnTyping.full), ccis) assert.strictEqual(math.cis(2*Math.PI), 1) }) }) diff --git a/src/core/TypeDispatcher.js b/src/core/TypeDispatcher.js index d8c6fc1..c56e39d 100644 --- a/src/core/TypeDispatcher.js +++ b/src/core/TypeDispatcher.js @@ -155,7 +155,8 @@ export class TypeDispatcher { const types = args.map(thisTypeOf) return this.resolve(key, types)(...args) } - standard.resolve = (types) => this.resolve(key, types) + standard.resolve = + (types, strategy) => this.resolve(key, types, strategy) standard.isDispatcher = true Object.defineProperty(this, key, { enumerable: true,