Type inference for return types (issue #10).