dukat icon indicating copy to clipboard operation
dukat copied to clipboard

Redundant type param in unrolled function

Open Schahen opened this issue 5 years ago • 0 comments

Following code:

interface MapLike<K, V> { } 
interface LinkedList<T> { } 

type ListOrMultiMap<K,V> = LinkedList<V> | MapLike<K, LinkedList<V>>;

declare function aliasUnionFunctionT<T>(a: ListOrMultiMap<T,String>);

is translated to:


external interface MapLike<K, V>

external interface LinkedList<T>

external fun <T> aliasUnionFunctionT(a: LinkedList<String>)

external fun <T> aliasUnionFunctionT(a: MapLike<T, LinkedList<String>>)

In first case T is redundant since it's actually unused.

Schahen avatar Jun 26 '20 13:06 Schahen