From 01658b13c2dfb6d274b25dc5d7f875fc6fb13cc5 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Wed, 3 Aug 2022 09:42:13 -0700 Subject: [PATCH] test(templates): Add one more (unfortunate) test case --- test/custom.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/custom.mjs b/test/custom.mjs index 76bb88a..a5eece7 100644 --- a/test/custom.mjs +++ b/test/custom.mjs @@ -129,9 +129,12 @@ describe('A custom instance', () => { assert.strictEqual( inst.typeMerge(3, inst.complex(4.5,2.1)), 'Merge to Complex') - // The following is the current behavior, since both `3+0i` and `3n + 0ni` - // are Complex, but it is unfortunate and hopefully it will be fixed - // with templates: + // The following is the current behavior, since 3 converts to 3+0i + // and 3n converts to 3n+0ni, both of which are technically Complex. + // This will remain the case even with templated Complex, because + // both Complex and Complex will refine Complex (for the + // sake of catching new specializations). Not sure whether that will be + // OK or a problem that will have to be dealt with. assert.strictEqual(inst.typeMerge(3, 3n), 'Merge to Complex') }) })