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
The Type { toUpperCase: () => string; } | undefined should be assignable the value '', but when I get a type like the aforementioned type using checker.getTypeAtLocation(node) and then use it like isAssignableToValue(type, '') it returns false.
You can clearly see that it should work by just trying it out in the TS playground:
The Type
{ toUpperCase: () => string; } | undefined
should be assignable the value''
, but when I get a type like the aforementioned type usingchecker.getTypeAtLocation(node)
and then use it likeisAssignableToValue(type, '')
it returns false.You can clearly see that it should work by just trying it out in the TS playground:
let x: { toUpperCase: () => string; } | undefined = '';
TS has no problem with the above code b/c
''
"looks like" a string (since all strings have.toUpperCase()
which returns a string.The text was updated successfully, but these errors were encountered: