Re:Nil in Go is typed in theory and sort of untyped in practice
by mirekrusin on Wednesday March 31, 2021 @04:28PM
(#26652707)
Yeah, that one is funny
[ Parent
| on HN ]
Re:Nil in Go is typed in theory and sort of untyped in practice
by mirekrusin on Wednesday March 31, 2021 @04:31PM
(#26652746)
However typescript says:
This condition will always return 'false' since the types 'never[]' and 'boolean' have no overlap.
...for `[] == ![]`. Which is ironic because it does return true, not false. However at least it flags an error!I wonder how much of weirdness is wiped out by linters/ts/etc.