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
While the generics are generally indicating that one and two are independent values, they can still potentially be the same underlying value so they should be able to at least be checked for equality without casting them first, especially since there is no error produced when calling the function with identical values in the first place.
At the very least the error message should be more specific since the assumption it is providing is not correct in since the condition returns true :-P
( This is clearly a simplified version of where I ran into this since there'd be no reason to use generics in this specific case :-) )
TypeScript Version: 3.8
Search Terms:
generic comparison
compare generic strings
Code
Expected behavior:
While the generics are generally indicating that
one
andtwo
are independent values, they can still potentially be the same underlying value so they should be able to at least be checked for equality without casting them first, especially since there is no error produced when calling the function with identical values in the first place.At the very least the error message should be more specific since the assumption it is providing is not correct in since the condition returns true :-P
( This is clearly a simplified version of where I ran into this since there'd be no reason to use generics in this specific case :-) )
Actual behavior:
Shown in example
Playground Link: Playground
The text was updated successfully, but these errors were encountered: