feat: Template types #45
@ -136,5 +136,10 @@ describe('A custom instance', () => {
|
|||||||
// sake of catching new specializations). Not sure whether that will be
|
// sake of catching new specializations). Not sure whether that will be
|
||||||
// OK or a problem that will have to be dealt with.
|
// OK or a problem that will have to be dealt with.
|
||||||
assert.strictEqual(inst.typeMerge(3, 3n), 'Merge to Complex')
|
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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user