Hacker News new | ask | show | jobs
by mdlayher 2198 days ago
In this particular case, the compiler can't infer the type of V if you omit the type parameters at the call sites:

  type checking failed for main
  prog.go2:17:3: cannot infer V (prog.go2:46:27)
  prog.go2:22:3: cannot infer V (prog.go2:46:27)
But generally you are right, yes. It is able to infer K at least.