FIR: Unwrap type aliases in type arguments
This commit is contained in:
committed by
teamcityserver
parent
4f08e1550d
commit
c4862fb124
+7
@@ -0,0 +1,7 @@
|
||||
FILE: main.kt
|
||||
public final typealias ImmutableMap<K, V> = R|MyMap<K, V>|
|
||||
public final typealias ImmutableSet<E> = R|MySet<E>|
|
||||
private final typealias ImmutableMultimap<K, V> = R|ImmutableMap<K, ImmutableSet<V>>|
|
||||
private final fun <K, V> R|ImmutableMultimap<K, V>|.put(key: R|K|, value: R|V|, oldSet: R|ImmutableSet<V>|): R|ImmutableMultimap<K, V>| {
|
||||
^put this@R|/put|.R|SubstitutionOverride</MyMap.put: R|ft<MyMap<ft<K, K?>, ft<ImmutableSet<V>, ImmutableSet<V>?>>, MyMap<ft<K, K?>, ft<ImmutableSet<V>, ImmutableSet<V>?>>?>|>|(R|<local>/key|, R|<local>/oldSet|.R|SubstitutionOverride</MySet.add: R|ft<MySet<ft<V, V?>>, MySet<ft<V, V?>>?>|>|(R|<local>/value|))
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// FILE: MyMap.java
|
||||
|
||||
public interface MyMap<K, V> {
|
||||
public MyMap<K, V> put(K k, V v);
|
||||
}
|
||||
// FILE: MySet.java
|
||||
|
||||
public interface MySet<E> {
|
||||
public MySet<E> add(E e);
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
typealias ImmutableMap<K, V> = MyMap<K, V>
|
||||
typealias ImmutableSet<E> = MySet<E>
|
||||
|
||||
private typealias ImmutableMultimap<K, V> = ImmutableMap<K, ImmutableSet<V>>
|
||||
|
||||
private fun <K, V> ImmutableMultimap<K, V>.put(key: K, value: V, oldSet: ImmutableSet<V>): ImmutableMultimap<K, V> {
|
||||
return put(key, oldSet.add(value))
|
||||
}
|
||||
Reference in New Issue
Block a user