4 ms·
> Any compiler of sound mind and memory will issue an error GHC would beg to differ.
by Gaelan 10y ago
> Any compiler of sound mind and memory will issue an error
GHC would beg to differ.
- mattnewton 10y agoThat was my first thought, that this is being presented as a fundamental tenant of compilers and really it's a design choice that a whole family of languages, some of them that people even use, didnt make.
- masklinn 10y agoAlso rustc, though it doesn't quite have overloading in the Java sense: https://is.gd/s0oF79 https://is.gd/s0oF79
- cjensen 10y agoAda also allows return type overloading. A complaint against Ada is that it is hard for the compiler to figure out the right overloading in a complex statement with many nested function calls. My compilers prof took the time to show how to do it, and why it doesn't take much time. Too bad C's automatic conversions prevent this from being used in C++.