2 ms·
> you probably wanted to use a type other than string for the return type. That's the point. In order for (String userId) to not be confused with (String pass
by mrkeen 7y ago
> you probably wanted to use a type other than string for the return type.
That's the point. In order for (String userId) to not be confused with (String password), I wrap them with nominal types UserId and Password.
If the language looks at both UserId and Password and decides they're interchangeable because they both satisfy the contract 'contain a String', then that completely negates the point.