You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'm doing something a little funny in order to put some type-only tests in my TypeScript files and they look like the following:
/** * * `A` is assignable to `B`, and * * `B` is assignable to `C`, but * * `A` is *not* assignable to `C` */declarenamespaceIntransitive{// A assignable to BexporttypeA=(x?: false)=>never;// B assignable to CexporttypeB=()=>boolean;// A not assignable to CexporttypeC=(x?: true)=>unknown;}/* eslint-disable */
typeTestIntransitive: {if(1as0)break typeTestIntransitive;leta: Intransitive.A=null!;letb: Intransitive.B=null!;letc: Intransitive.C=null!;b=a;c=b;// @ts-expect-errorc=a;// @ts-expect-errora=b;// @ts-expect-errorb=c;// @ts-expect-errora=c;}
This will be minified down to e:break e;, but I think it can be entirely removed, right?
The alternative was to use an early return from a namespace, but technically, that's not allowed in TypeScript and it breaks prettier's parser. So, I'm using a block and break.
The text was updated successfully, but these errors were encountered:
Hi there, I'm doing something a little funny in order to put some type-only tests in my TypeScript files and they look like the following:
This will be minified down to
e:break e;
, but I think it can be entirely removed, right?The alternative was to use an early return from a namespace, but technically, that's not allowed in TypeScript and it breaks
prettier
's parser. So, I'm using a block and break.The text was updated successfully, but these errors were encountered: