Commit Graph

2 Commits

Author SHA1 Message Date
Anton Bannykh
318014e4ab Test vararg with Java behaviour only for JVM backends 2017-03-01 13:58:57 +03:00
Denis Zharkov
9e03b712de Use flexible upper bound of parameter's type for vararg argument
See the issue and the test. The problem was that when generating
call to `foo` method in member scope of `AT<*>` its resulting descriptor
after substitution and approximation was: fun foo(x: Nothing..Array<out Nothing>).

This signature is correct, but when using this parameter type
for generating a vararg argument the assertion is violated that
the type of the argument must be an array
(by default we're using lower flexible bound everywhere)

The solution is using upper bound for flexible types that should
always have a form of Array<out T> for varargs (even for such corner cases)
both for Kotlin and Java declarations.

 #KT-14607 Fixed
2017-02-28 10:40:54 +03:00