What if getFoo() doesn't have source code available?
Actually, that's the point I agree with most here. My time with typescript has somehow broken my brain to the point that I forgot that you don't always have to source code to the libraries you're working with (though I'd imagine you have the header files or whatever the equiv is in Java, no?) so you might not always be able to be too sure what getFoo()is actually returning....
that said, wouldn't shit just break at runtime in that instance when a method you expected to be there just...wasn't if getFoo has no declared return type available? Or would the JVM compiler still catch that and throw a compile error?
View all comments
Show parent comment
5
u/lenswipe Mar 11 '23
Actually, that's the point I agree with most here. My time with typescript has somehow broken my brain to the point that I forgot that you don't always have to source code to the libraries you're working with (though I'd imagine you have the header files or whatever the equiv is in Java, no?) so you might not always be able to be too sure what
getFoo()is actually returning....that said, wouldn't shit just break at runtime in that instance when a method you expected to be there just...wasn't if
getFoohas no declared return type available? Or would the JVM compiler still catch that and throw a compile error?