title: ExceptionInInitializerError "Parameter specified as non-null is null" with abstract class
body: <p>I need to calculate the <code>hash</code> of hard-coded images.</p>
  
  <pre><code>abstract class ImageData {
      protected abstract val master: List&lt;String&gt;
      val data: Iterable&lt;HexString&gt; = master.map { s -&gt; hex(s) }
      val hash: Int by lazy {
          master.fold(0) { hash, s -&gt;
              31 * hash + s.hashCode()
          }
      }
  }
  </code></pre>
  
  <p>Example image.</p>
  
  <pre><code>object FooImageData : ImageData() {
      override val master = listOf(
          "424d3684030000000000..."
          // ...
      )
  }
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
      at ....updateGraphics(Graphics.kt:162)
  ...
   Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter $this$collectionSizeOrDefault
      at kotlin.collections.CollectionsKt__IterablesKt.collectionSizeOrDefault(Iterables.kt)
      at ....ImageData.&lt;init&gt;(ImageData.kt:17)
      at ....FooImageData.&lt;init&gt;(FooImageData.kt:3)
      at ....FooImageData.&lt;clinit&gt;(FooImageData.kt:3)
      at ....updateGraphics(Graphics.kt:162)
  </code></pre>
  
  <p>at <code>....updateGraphics(Graphics.kt:162)</code> is:</p>
  
  <pre><code>private suspend fun updateGraphics(...) {
      val hash = (FooImageData.hash * 31 + BarImageData.hash)
  </code></pre>
  
  <p>Removing the <code>lazy</code> does not remove the problem.</p>
  
  <p>All research suggests the ordering of the parameters can be an issue but that seems to be not the case here - or is it?</p>
  
  <p>Using:</p>
  
  <pre><code>abstract class ImageData {
      abstract val master: List&lt;String&gt;
      // Yes I know the `get()` is unnecessary but for some weird reason that causes `hash` to crash.
      val data: Iterable&lt;HexString&gt; get() = master.map { s -&gt; hex(s) }
      val hash: Int by lazy {
          master.fold(0) { hash, s -&gt;
              31 * hash + s.hashCode()
          }
      }
  }
  </code></pre>
  
  <p>seems to solve the problem - no idea why.</p>
  
  <p>Kotlin version <code>Latest stable (1.3)</code></p>
  
  <p>Target JVM version: <code>1.6</code></p>