|
|
|
|
|
by jblow
3962 days ago
|
|
With this scheme you would end up with pretty bad problems regarding function pointers and lambdas. Because the type is deeply implicit, you would have two function pointers that look compatible but are totally incompatible. Then when you want to assign them to a variable -- how do you know a priori what type to declare the variable? |
|
Let's say we had the following C++ code:
What exceptions can be raised by foo?The answer is simply computed - "anything raised by its first argument except SomeException, plus the type of otherexception".
Such a system would be tremendously more flexible than Java's checked exceptions, while still allowing you to confidently restrict what might be thrown in a section of code.