title: Varargs Kotlin Java interop not working properly
body: <p>For the makeSceneTransitionAnimation there are two static functions</p>
  
  <pre><code>public static ActivityOptionsCompat makeSceneTransitionAnimation(Activity activity,
          View sharedElement, String sharedElementName)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>    public static ActivityOptionsCompat makeSceneTransitionAnimation(Activity activity,
          Pair&lt;View, String&gt;... sharedElements)
  </code></pre>
  
  <p>The first function call works properly in Kotlin but when calling the second one, both these calls return errors</p>
  
  <pre><code>        val imageTransition = Pair&lt;View, String&gt;(imageView, imageView.getTransitionName());
          val textTransition = Pair&lt;View, String&gt;(textView, textView.getTransitionName());
          val transitionList = Array(2, { imageTransition });
          transitionList[1] = textTransition;
          val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, *transitionList);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>        val imageTransition = Pair&lt;View, String&gt;(imageView, imageView.getTransitionName());
          val textTransition = Pair&lt;View, String&gt;(textView, textView.getTransitionName());
          val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, imageTransition, textTransition);
  </code></pre>
  
  <p>Is there a proper way to get this working or is this an issue with the interop?</p>
  
  <p><strong>Edit</strong>
  Added change to ensure that it is using the same classes</p>
  
  <pre><code>val imageView : View = view.findViewById(android.R.id.icon);
  val textView : View = view.findViewById(android.R.id.text1);
  imageView.setTransitionName("imageTransition");
  textView.setTransitionName("textTransition")
  
  val imageTransition : android.support.v4.util.Pair&lt;android.view.View, java.lang.String&gt; = android.support.v4.util.Pair.create(imageView, imageView.getTransitionName() as java.lang.String);
  val textTransition : android.support.v4.util.Pair&lt;android.view.View, java.lang.String&gt; = android.support.v4.util.Pair.create(textView, textView.getTransitionName() as java.lang.String);
  val transitionList = Array(2, { imageTransition });
  transitionList[1] = textTransition;
  val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, *transitionList);
  </code></pre>
  
  <p>Current compiler error: </p>
  
  <pre><code>Error:(72, 84) The spread operator (*foo) may only be applied in a vararg position
  Error:(72, 99) No value passed for parameter sharedElementName
  </code></pre>
  
  <p><em>And another</em></p>
  
  <pre><code>val imageView : View = view.findViewById(android.R.id.icon);
  val textView : View = view.findViewById(android.R.id.text1);
  imageView.setTransitionName("imageTransition");
  textView.setTransitionName("textTransition")
  
  val imageTransition : android.support.v4.util.Pair&lt;android.view.View, java.lang.String&gt; = android.support.v4.util.Pair.create(imageView, imageView.getTransitionName() as java.lang.String);
  val textTransition : android.support.v4.util.Pair&lt;android.view.View, java.lang.String&gt; = android.support.v4.util.Pair.create(textView, textView.getTransitionName() as java.lang.String);
  val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, imageTransition, textTransition);
  </code></pre>
  
  <p>Current compiler error: </p>
  
  <pre><code>Error:(72, 84) Type mismatch: inferred type is android.support.v4.util.Pair&lt;android.view.View, java.lang.String&gt; but android.view.View! was expected
  Error:(72, 101) Type mismatch: inferred type is android.support.v4.util.Pair&lt;android.view.View, java.lang.String&gt; but kotlin.String! was expected
  </code></pre>