title: How do I need to write the 3rd line - Not enough information to infer type variable T
body: <p>I'm new to Kotlin and try to convert a project from Java to Kotlin<br />
  I just need one last step and I don't understand what's going on :(</p>
  <p>I'm getting a <code>Not enough information to infer type variable T</code> on <code>model.predict</code> call</p>
  <pre class="lang-kotlin prettyprint-override"><code>override fun link(word: String): LinkSuggestion {
      val input: DoubleArray = gramToInt.toArray(word)
      val output: Array&lt;Any&gt; = model.predict(input)
                                  // ~~~~~~~ Not enough information to infer type variable T
      val maxPredictionIndex: Int = (output[output.size - 1] as Long).toInt()
      val maxPredictionProbability: Double = output[maxPredictionIndex] as Double
      return LinkSuggestion(word, intToLink.fromInt(maxPredictionIndex), maxPredictionProbability)
  }
  </code></pre>
  <p>where <code>model</code> is <code>import org.pmml4s.model.Model</code></p>
  <hr />
  <p>The previous Java code:</p>
  <pre class="lang-java prettyprint-override"><code>@Override
  public LinkSuggestion link(String word) {
      double[] input = gramToInt.toArray(word);
      Object[] output = model.predict(input);
      int maxPredictionIndex = ((Long) output[output.length - 1]).intValue();
      double maxPredictionProbability = (Double) output[maxPredictionIndex];
      return new LinkSuggestion(word, intToLink.fromInt(maxPredictionIndex), maxPredictionProbability);
  }
  </code></pre>