KiaraGrouwstra / typical

playground for type-level primitives in TypeScript
MIT License
173 stars 5 forks source link

Error for the Not type #1

Closed atennapel closed 7 years ago

atennapel commented 7 years ago

I'm getting

Type 'T' cannot be used to index type '{ '1': "0"; '0': "1"; }'.

when I try

type Not<T extends string> = { '1': '0'; '0': '1'; }[T];
atennapel commented 7 years ago

Nevermind I messed up the type, should be Not<T extends Bool>...

KiaraGrouwstra commented 7 years ago

Thanks for posting. You didn't mess up; I only just pushed that after seeing your post.

Until a bit earlier I was accidentally compiling using a local tsc on version 2.3.3, so I'd yet to notice the issues on the TS nightly, including this one.

I've been sporadically looking with the issues on the nightly over the last few days. I'm still experiencing both errors and some non-terminating types. I'll try to push further fixes as I figure things out.