groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Harvey <nathanwhar...@gmail.com>
Subject Lack of a wild card in DefaultGroovyMethods
Date Wed, 27 Dec 2017 02:11:36 GMT
A few methods in DefaultGroovyMethods don't utilize wildcards, for example,
the Map plus operator:

public static <K, V> Map<K, V> plus(Map<K, V> left, Map<K, V> right)
{ ... }

Which causes a compile error on the following, for example:

Map<String, Object> map = [:]
map + [hello: 'world']

A few other methods might suffer from this problem. Does anyone have
anything against changing them to support wildcards? eg: plus(Map<K, V>
left, Map<? extends K, ? extends V> right)



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Mime
View raw message