The generic parameters Any of kotlin are converted to wildcards(?) : <p>I encountered an issue when I used kotlin and retrofit2,The generic parameters of kotlin are converted to wildcards(?),but not in java.</p>

<p>now, I need a parameter <code>Map&lt;String, Object&gt;</code>(The key is the String type, the value is not fixed) in java,convert to kotlin code is <code>Map&lt;String, Any&gt;</code>.</p>

<p>But retrofit treats them differently.</p>

<p><code>Map&lt;String, Object&gt;</code> in java be compiled into <code>[java.util.Map&lt;java.lang.String, java.lang.Object&gt;]</code>,and works correctly.</p>

<p><code>Map&lt;String, Any&gt;</code> in kotlin be compiled into <code>[java.util.Map&lt;java.lang.String, ?&gt;]</code>,and the retrofit2 throws parameterError(Parameter type must not include a type variable or wildcard).</p>

<p>1、Retrofit related code</p>

<pre><code>public ServiceMethod build() {
    ……
    for (int p = 0; p &lt; parameterCount; p++) {
        Type parameterType = parameterTypes[p];
        if (Utils.hasUnresolvableType(parameterType)) {
            throw parameterError(p, "Parameter type must not include a type variable or wildcard: %s", parameterType);
        }
        ……
    }
    ……
}
</code></pre>

<p>Utils.hasUnresolvableType(parameterType) method is quoted as follows</p>

<pre><code>final class Utils {
    ……
    static boolean hasUnresolvableType(Type type) {
        ……
        if (type instanceof WildcardType) {
            return true;
        }
        ……

    }
    ……
}
</code></pre>

<p>2、interface in java, I need a parameter <code>Map&lt;String, Object&gt;</code>(The key is the String type, the value is not fixed), it be compiled into <code>[java.util.Map&lt;java.lang.String, java.lang.Object&gt;]</code>,and works correctly.</p>

<pre><code>@GET("/index.html")
Observable&lt;ResponseBody&gt; getQueryMap(@QueryMap Map&lt;String, Object&gt; params);
</code></pre>

<p>3、interface in kotlin,I need a parameter <code>Map&lt;String, Any&gt;</code>(The key is the String type, the value is not fixed), but it be compiled into <code>[java.util.Map&lt;java.lang.String, ?&gt;]</code>,and the retrofit2 throws parameterError(Parameter type must not include a type variable or wildcard).</p>

<pre><code>@GET("/index.html")
fun getQueryMap(@QueryMap paramsMap: Map&lt;String, Any&gt;): Observable&lt;ResponseBody&gt;
</code></pre>
