test(templates): Add one more (unfortunate) test case

This commit is contained in:
Glen Whitney 2022-08-03 09:42:13 -07:00
parent 5dab7d64e7
commit 01658b13c2
1 changed files with 6 additions and 3 deletions

View File

@ -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<bigint> and Complex<NumInt> 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')
})
})