test(templates): Check that unjoinable types are detected

This commit is contained in:
Glen Whitney 2022-08-03 10:20:34 -07:00
parent 01658b13c2
commit 21ce098f98
1 changed files with 5 additions and 0 deletions

View File

@ -136,5 +136,10 @@ describe('A custom instance', () => {
// 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')
// But types that truly cannot be merged should throw a TypeError
// Should add a variation of this with a more usual type once there is
// one not interconvertible with others...
inst.install(genericSubtract)
assert.throws(() => inst.typeMerge(3, undefined), TypeError)
})
})