Re:A Failed Experiment with Python Type Annotations
by joshuamorton on Tuesday June 11, 2019 @05:56PM
(#20159877)
Yuck, apparently I missed this happening. Its still (I think) true in java, where you can't have a function return `var`.
[ Parent
| on HN ]
Re:A Failed Experiment with Python Type Annotations
by kjeetgill on Wednesday June 12, 2019 @02:52AM
(#20162351)
You're correct about Java. It was an explicit decision that the only local variable's type declarations and lambda parameters may be inferred with `var`.
This excludes, as you mentioned, the return types of a function, its parameter's types, as well as the types of fields in a class.