Skip to content

Commit 5350160

Browse files
Gooolerqurbonzoda
authored andcommitted
Enable Explicit API mode
1 parent 3ea58c0 commit 5350160

File tree

7 files changed

+100
-99
lines changed

7 files changed

+100
-99
lines changed

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ mavenPublicationsPom {
1515

1616
kotlin {
1717
applyDefaultHierarchyTemplate()
18+
explicitApi()
1819

1920
// According to https://kotlinlang.org/docs/native-target-support.html
2021
// Tier 1

core/commonMain/src/ImmutableCollection.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ public interface PersistentCollection<out E> : ImmutableCollection<E> {
3131
* @returns a new persistent collection with the specified [element] added;
3232
* or this instance if this collection does not support duplicates and it already contains the element.
3333
*/
34-
fun add(element: @UnsafeVariance E): PersistentCollection<E>
34+
public fun add(element: @UnsafeVariance E): PersistentCollection<E>
3535

3636
/**
3737
* Returns the result of adding all elements of the specified [elements] collection to this collection.
3838
*
3939
* @return a new persistent collection with elements of the specified [elements] collection added;
4040
* or this instance if no modifications were made in the result of this operation.
4141
*/
42-
fun addAll(elements: Collection<@UnsafeVariance E>): PersistentCollection<E>
42+
public fun addAll(elements: Collection<@UnsafeVariance E>): PersistentCollection<E>
4343

4444
/**
4545
* Returns the result of removing a single appearance of the specified [element] from this collection.
4646
*
4747
* @return a new persistent collection with a single appearance of the specified [element] removed;
4848
* or this instance if there is no such element in this collection.
4949
*/
50-
fun remove(element: @UnsafeVariance E): PersistentCollection<E>
50+
public fun remove(element: @UnsafeVariance E): PersistentCollection<E>
5151

5252
/**
5353
* Returns the result of removing all elements in this collection that are also
@@ -57,15 +57,15 @@ public interface PersistentCollection<out E> : ImmutableCollection<E> {
5757
* contained in the specified [elements] collection removed;
5858
* or this instance if no modifications were made in the result of this operation.
5959
*/
60-
fun removeAll(elements: Collection<@UnsafeVariance E>): PersistentCollection<E>
60+
public fun removeAll(elements: Collection<@UnsafeVariance E>): PersistentCollection<E>
6161

6262
/**
6363
* Returns the result of removing all elements in this collection that match the specified [predicate].
6464
*
6565
* @return a new persistent collection with elements matching the specified [predicate] removed;
6666
* or this instance if no elements match the predicate.
6767
*/
68-
fun removeAll(predicate: (E) -> Boolean): PersistentCollection<E>
68+
public fun removeAll(predicate: (E) -> Boolean): PersistentCollection<E>
6969

7070
/**
7171
* Returns all elements in this collection that are also
@@ -75,12 +75,12 @@ public interface PersistentCollection<out E> : ImmutableCollection<E> {
7575
* contained in the specified [elements] collection;
7676
* or this instance if no modifications were made in the result of this operation.
7777
*/
78-
fun retainAll(elements: Collection<@UnsafeVariance E>): PersistentCollection<E>
78+
public fun retainAll(elements: Collection<@UnsafeVariance E>): PersistentCollection<E>
7979

8080
/**
8181
* Returns an empty persistent collection.
8282
*/
83-
fun clear(): PersistentCollection<E>
83+
public fun clear(): PersistentCollection<E>
8484

8585
/**
8686
* A generic builder of the persistent collection. Builder exposes its modification operations through the [MutableCollection] interface.
@@ -98,7 +98,7 @@ public interface PersistentCollection<out E> : ImmutableCollection<E> {
9898
*
9999
* When [build] is called the builder forgets about all owned nodes it had created.
100100
*/
101-
interface Builder<E>: MutableCollection<E> {
101+
public interface Builder<E>: MutableCollection<E> {
102102
/**
103103
* Returns a persistent collection with the same contents as this builder.
104104
*
@@ -108,13 +108,13 @@ public interface PersistentCollection<out E> : ImmutableCollection<E> {
108108
* - on the first call it returns the same persistent collection instance this builder was obtained from.
109109
* - on subsequent calls it returns the same previously returned persistent collection instance.
110110
*/
111-
fun build(): PersistentCollection<E>
111+
public fun build(): PersistentCollection<E>
112112
}
113113

114114
/**
115115
* Returns a new builder with the same contents as this collection.
116116
*
117117
* The builder can be used to efficiently perform multiple modification operations.
118118
*/
119-
fun builder(): Builder<@UnsafeVariance E>
119+
public fun builder(): Builder<@UnsafeVariance E>
120120
}

core/commonMain/src/ImmutableList.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,28 +125,28 @@ public interface PersistentList<out E> : ImmutableList<E>, PersistentCollection<
125125
*
126126
* @throws IndexOutOfBoundsException if [index] is out of bounds of this list.
127127
*/
128-
fun addAll(index: Int, c: Collection<@UnsafeVariance E>): PersistentList<E> // = builder().apply { addAll(index, c.toList()) }.build()
128+
public fun addAll(index: Int, c: Collection<@UnsafeVariance E>): PersistentList<E> // = builder().apply { addAll(index, c.toList()) }.build()
129129

130130
/**
131131
* Returns a new persistent list with the element at the specified [index] replaced with the specified [element].
132132
*
133133
* @throws IndexOutOfBoundsException if [index] is out of bounds of this list.
134134
*/
135-
fun set(index: Int, element: @UnsafeVariance E): PersistentList<E>
135+
public fun set(index: Int, element: @UnsafeVariance E): PersistentList<E>
136136

137137
/**
138138
* Returns a new persistent list with the specified [element] inserted at the specified [index].
139139
*
140140
* @throws IndexOutOfBoundsException if [index] is out of bounds of this list.
141141
*/
142-
fun add(index: Int, element: @UnsafeVariance E): PersistentList<E>
142+
public fun add(index: Int, element: @UnsafeVariance E): PersistentList<E>
143143

144144
/**
145145
* Returns a new persistent list with the element at the specified [index] removed.
146146
*
147147
* @throws IndexOutOfBoundsException if [index] is out of bounds of this list.
148148
*/
149-
fun removeAt(index: Int): PersistentList<E>
149+
public fun removeAt(index: Int): PersistentList<E>
150150

151151
/**
152152
* A generic builder of the persistent list. Builder exposes its modification operations through the [MutableList] interface.
@@ -164,7 +164,7 @@ public interface PersistentList<out E> : ImmutableList<E>, PersistentCollection<
164164
*
165165
* When [build] is called the builder forgets about all owned nodes it had created.
166166
*/
167-
interface Builder<E>: MutableList<E>, PersistentCollection.Builder<E> {
167+
public interface Builder<E>: MutableList<E>, PersistentCollection.Builder<E> {
168168
override fun build(): PersistentList<E>
169169
}
170170

core/commonMain/src/ImmutableMap.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ public interface PersistentMap<K, out V> : ImmutableMap<K, V> {
4747
* @return a new persistent map with the specified [value] associated with the specified [key];
4848
* or this instance if no modifications were made in the result of this operation.
4949
*/
50-
fun put(key: K, value: @UnsafeVariance V): PersistentMap<K, V>
50+
public fun put(key: K, value: @UnsafeVariance V): PersistentMap<K, V>
5151

5252
/**
5353
* Returns the result of removing the specified [key] and its corresponding value from this map.
5454
*
5555
* @return a new persistent map with the specified [key] and its corresponding value removed;
5656
* or this instance if it contains no mapping for the key.
5757
*/
58-
fun remove(key: K): PersistentMap<K, V>
58+
public fun remove(key: K): PersistentMap<K, V>
5959

6060
/**
6161
* Returns the result of removing the entry that maps the specified [key] to the specified [value].
6262
*
6363
* @return a new persistent map with the entry for the specified [key] and [value] removed;
6464
* or this instance if it contains no entry with the specified key and value.
6565
*/
66-
fun remove(key: K, value: @UnsafeVariance V): PersistentMap<K, V>
66+
public fun remove(key: K, value: @UnsafeVariance V): PersistentMap<K, V>
6767

6868
/**
6969
* Returns the result of merging the specified [m] map with this map.
@@ -74,12 +74,12 @@ public interface PersistentMap<K, out V> : ImmutableMap<K, V> {
7474
* @return a new persistent map with keys and values from the specified map [m] associated;
7575
* or this instance if no modifications were made in the result of this operation.
7676
*/
77-
fun putAll(m: Map<out K, @UnsafeVariance V>): PersistentMap<K, V> // m: Iterable<Map.Entry<K, V>> or Map<out K,V> or Iterable<Pair<K, V>>
77+
public fun putAll(m: Map<out K, @UnsafeVariance V>): PersistentMap<K, V> // m: Iterable<Map.Entry<K, V>> or Map<out K,V> or Iterable<Pair<K, V>>
7878

7979
/**
8080
* Returns an empty persistent map.
8181
*/
82-
fun clear(): PersistentMap<K, V>
82+
public fun clear(): PersistentMap<K, V>
8383

8484
/**
8585
* A generic builder of the persistent map. Builder exposes its modification operations through the [MutableMap] interface.
@@ -97,7 +97,7 @@ public interface PersistentMap<K, out V> : ImmutableMap<K, V> {
9797
*
9898
* When [build] is called the builder forgets about all owned nodes it had created.
9999
*/
100-
interface Builder<K, V>: MutableMap<K, V> {
100+
public interface Builder<K, V>: MutableMap<K, V> {
101101
/**
102102
* Returns a persistent map with the same contents as this builder.
103103
*
@@ -107,13 +107,13 @@ public interface PersistentMap<K, out V> : ImmutableMap<K, V> {
107107
* - on the first call it returns the same persistent map instance this builder was obtained from.
108108
* - on subsequent calls it returns the same previously returned persistent map instance.
109109
*/
110-
fun build(): PersistentMap<K, V>
110+
public fun build(): PersistentMap<K, V>
111111
}
112112

113113
/**
114114
* Returns a new builder with the same contents as this map.
115115
*
116116
* The builder can be used to efficiently perform multiple modification operations.
117117
*/
118-
fun builder(): Builder<K, @UnsafeVariance V>
118+
public fun builder(): Builder<K, @UnsafeVariance V>
119119
}

core/commonMain/src/ImmutableSet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public interface PersistentSet<out E> : ImmutableSet<E>, PersistentCollection<E>
100100
*
101101
* When [build] is called the builder forgets about all owned nodes it had created.
102102
*/
103-
interface Builder<E>: MutableSet<E>, PersistentCollection.Builder<E> {
103+
public interface Builder<E>: MutableSet<E>, PersistentCollection.Builder<E> {
104104
override fun build(): PersistentSet<E>
105105
}
106106

0 commit comments

Comments
 (0)