|
|
|
|
|
by majormajor
340 days ago
|
|
This seems to be a golden rule of many languages? `return 3` in a function with a signature that says it's going to return a string is going to fail in a lot of places, especially once you exclude bolted-on-after-the-fact type hinting like what Python has. It's easier to "abuse" in some languages with casts, and of course borrow checking is not common, but it also seems like just "typed function signatures 101". Are there common exceptions to this out there, where you can call something that says it takes or returns one type but get back or send something entirely different? |
|