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
Mutable function params gets a little wonky with generic type because you could have something like:
fnfoo<T>(mutx: T){ ... }
Since primitive types like string, number, etc. are immutable the type system will complain if you try to do:
letbar=5;foo(bar);// error, can't pass immutable argument to mutable param
This should be allowed though since primitives/literals can never be mutated (although a mutable variable whose type is a primitive can be re-assigned to another inhabitant of primitive type).
The text was updated successfully, but these errors were encountered:
Mutable function params gets a little wonky with generic type because you could have something like:
Since primitive types like string, number, etc. are immutable the type system will complain if you try to do:
This should be allowed though since primitives/literals can never be mutated (although a mutable variable whose type is a primitive can be re-assigned to another inhabitant of primitive type).
The text was updated successfully, but these errors were encountered: