79080778

Date: 2024-10-12 10:19:56
Score: 1.5
Natty:
Report link

I tried the approach from @Aidin:

class Example<
    T extends (string extends T ? never : string),
> {}

Which gave me this error:

Type parameter 'T' has a circular constraint.ts(2313)

This fixed it for me:

class Example<
  T extends string & (string extends T ? never : unknown)
> {}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Aidin
  • Low reputation (0.5):
Posted by: Janek Eilts