title: Unresolved reference of a Kotlin extension function in the Gradle build
body: <p>I have multi project Gradle build with all the code written in Kotlin. There are two projects in it: common and client. Subprojects are in the intermediate folder, say "demo". So the folder structure is:</p>
  
  <pre><code>project
    demo
      client
        build.gradle
      common
        build.gradle
    build.gradle
    gradle.properties
    settings.gradle
  </code></pre>
  
  <p>The settings.gradle:</p>
  
  <pre><code>rootProject.name = 'demo'
  
  include 'demo/client'
  include 'demo/common'
  </code></pre>
  
  <p>Client dependes on the common project <code>compile project(":demo/common")</code>. And there is an extension function in the common project:</p>
  
  <pre><code>fun &lt;T&gt; List&lt;Future&lt;T&gt;&gt;.getAll(): Long {
      var count = 0L
      this.forEach {
          it.get()
          count++
      }
      return count
  }
  </code></pre>
  
  <p>If I try to use it in the client project I get <code>Unresolved reference: getAll</code> exception at the compilation time. The usage:</p>
  
  <pre><code>...
  import org.sandbox.imdg.hazelcast.common.utils.getAll
  
  class CassLoader {
  
      fun loadCalcData(): Long {
          ...
          val futures: List&lt;Future&lt;CalcData&gt;&gt; = items.map { map.putAsync(it.getKey(), it) }
          return futures.getAll()
      }
  }
  </code></pre>
  
  <p>At the same time everything compile fine if I put the <code>getAll</code> declaration in the client project. I'm pretty sure that the import of the function is correct but at the same time I had a little experience with Gradle so might miss something.</p>
  
  <ul>
  <li>Build: <code>gradlew clean build</code></li>
  <li>Kotlin: 1.0.2 </li>
  <li>Gradle: 2.9</li>
  </ul>
  
  <p>UPD: The problem is in the folder structure (or may be I'm declaring dependencies wrong...) - if I remove intermediate folder demo everytning is ok.</p>