feat(PocomathInstance): Add bounded template parameters

This feature helps specify the return type of implementations where
  the return type depends on the exact subtype that the implementation
  was called with, such as negate.
This commit is contained in:
Glen Whitney 2022-08-22 12:38:23 -04:00
parent dc6921e768
commit f7bb3697ed
4 changed files with 77 additions and 65 deletions

View file

@ -27,7 +27,7 @@ describe('The default full pocomath instance "math"', () => {
it('can subtract numbers', () => {
assert.strictEqual(math.subtract(12, 5), 7)
//assert.strictEqual(math.subtract(3n, 1.5), 1.5)
assert.throws(() => math.subtract(3n, 1.5), 'TypeError')
})
it('can add numbers', () => {