4 ms·
> In a language that's as strongly typed as Rust Isn't this more-or-less true of any statically-typed language? I can't think of any off the top of my head tha
by smitherfield 9y ago
> In a language that's as strongly typed as Rust
Isn't this more-or-less true of any statically-typed language? I can't think of any off the top of my head that have the behavior of implicitly re-defining a type when a new definition is encountered after another definition was previously brought into scope.
Even C isn't that sadistic:
$ echo "\
> #include <time.h>
> struct tm {};" | cc -ansi -xc -
<stdin>:2:8: error: redefinition of 'struct tm'
struct tm {};
^~
In file included from <stdin>:1:0:
/usr/include/time.h:74:8: note: originally defined here
struct tm {
^~
- steveklabnik 9y agoAbsolutely, I was trying to communicate that this is true across a ton of languages. This one isn't super specific to Rust; others may be depending on the exact feature.