Type inference quirks of closures as parameters