Report error if some deserialized classes are missing in dependencies
Technically we often can compile code which uses missing classes (as long as nothing is called on them) but it seems better to let the user know something's wrong in their setup before the error manifests itself at runtime. Also the Java compiler does the same #KT-4328 Fixed
This commit is contained in:
@@ -41,8 +41,7 @@ fun <K> Iterable<K>.mapToIndex(): Map<K, Int> {
|
||||
return map
|
||||
}
|
||||
|
||||
|
||||
public inline fun <K, V> MutableMap<K, V>.getOrPutNullable(key: K, defaultValue: () -> V): V {
|
||||
inline fun <K, V> MutableMap<K, V>.getOrPutNullable(key: K, defaultValue: () -> V): V {
|
||||
return if (!containsKey(key)) {
|
||||
val answer = defaultValue()
|
||||
put(key, answer)
|
||||
@@ -71,6 +70,10 @@ fun <E> newHashSetWithExpectedSize(expectedSize: Int): HashSet<E> {
|
||||
return HashSet(if (expectedSize < 3) 3 else expectedSize + expectedSize / 3 + 1)
|
||||
}
|
||||
|
||||
fun <E> newLinkedHashSetWithExpectedSize(expectedSize: Int): LinkedHashSet<E> {
|
||||
return LinkedHashSet(if (expectedSize < 3) 3 else expectedSize + expectedSize / 3 + 1)
|
||||
}
|
||||
|
||||
fun <T> Collection<T>.toReadOnlyList(): List<T> =
|
||||
when (size) {
|
||||
0 -> emptyList()
|
||||
|
||||
Reference in New Issue
Block a user