How do I create an enum from a Int in Kotlin? : <p>I have this <code>enum</code>:</p>

<pre><code>enum class Types(val value: Int) {
    FOO(1)
    BAR(2)
    FOO_BAR(3)
}
</code></pre>

<p>How do I create an instance of that <code>enum</code> using an <code>Int</code>?</p>

<p>I tried doing something like this:</p>

<pre><code>val type = Types.valueOf(1)
</code></pre>

<p>And I get the error:</p>

<blockquote>
  <p>Integer literal does not conform to the expected type String</p>
</blockquote>
