title: Generics: Type argument is not within its bounds
body: <p>Any idea why the following code wouldn't compile? </p>
  
  <pre><code>fun &lt;T : Comparable&lt;T&gt;&gt; naturalSort(list: List&lt;T&gt;): List&lt;T&gt; {
    val natComparator = naturalOrder&lt;T&gt;() // compiler error here
  
    return list.sortedWith(natComparator)
  }
  </code></pre>
  
  <p>The second line results in the compiler error: </p>
  
  <blockquote>
    <p>Type argument is not within its bounds: should be subtype of 'Comparable'</p>
  </blockquote>
  
  <p><b>Update</b>:
  It works for me in <a href="https://play.kotlinlang.org/" rel="nofollow noreferrer">https://play.kotlinlang.org/</a> but fails in Eclipse and when building the project (from Eclipse) with the project's Gradle build script. </p>
  
  <p>Here's how my Gradle build environment looks like:</p>
  
  <p><a href="https://pastebin.com/0GDUWy2C" rel="nofollow noreferrer">https://pastebin.com/0GDUWy2C</a></p>