gvergnaud / hotscript

A library of composable functions for the type-level! Transform your TypeScript types in any way you want using functions you already know.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Negate<0>` returns `number | bigint`

dimitropoulos opened this issue · comments

Hi!

I noticed that Negate<0> returns number | bigint and I'd expect it to return 0 (doesn't seem like TypeScript has -0, which is fine by me).

import { Call, Numbers } from 'hotscript'

type ShouldBeZero = Call<Numbers.Negate<0>>
//   ^?

type Zero = -0;
//   ^?

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYQIYBt0Bo4DkCuIARgKZQDOcAvnAGZQQhwDkAFhDOQMZTBgzMAUIJgBPMCTgBldvnQATAEIkAWmQhwAvCgzoAPAWJlyAOlwkA5qhgk9ABgB8DwQHoXcDwD0A-MLES4NQYtOABaOwBuV3cvbyA