[K/N] Stdlib: warnings as errors

Fix or suppress warnings in Native stdlib.
This commit is contained in:
Pavel Punegov
2021-11-17 15:19:53 +03:00
committed by Space
parent d3d21f072a
commit 0249b7ed74
7 changed files with 64 additions and 63 deletions
@@ -26,7 +26,7 @@ enum class FutureState(val value: Int) {
* Class representing abstract computation, whose result may become available in the future.
*/
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
public inline class Future<T> @PublishedApi internal constructor(val id: Int) {
public value class Future<T> @PublishedApi internal constructor(val id: Int) {
/**
* Blocks execution until the future is ready.
*
@@ -27,7 +27,7 @@ import kotlinx.cinterop.*
* Class representing worker.
*/
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
public inline class Worker @PublishedApi internal constructor(val id: Int) {
public value class Worker @PublishedApi internal constructor(val id: Int) {
companion object {
/**
* Start new scheduling primitive, such as thread, to accept new tasks via `execute` interface.
@@ -12,6 +12,7 @@ internal class KClassImpl<T : Any>(private val typeInfo: NativePtr) : KClass<T>
@ExportForCompiler
@ConstantConstructorIntrinsic("KCLASS_IMPL")
@Suppress("UNREACHABLE_CODE")
constructor() : this(TODO("This is intrinsic constructor and it shouldn't be used directly"))
// TODO: consider replacing '$' by another delimeter that can't be used in class name specified with backticks (``)
@@ -57,6 +57,7 @@ internal class KTypeImpl<T>(
@ExportForCompiler
@ConstantConstructorIntrinsic("KTYPE_IMPL")
@Suppress("UNREACHABLE_CODE")
constructor() : this(null, TODO("This is intrinsic constructor and it shouldn't be used directly"), false)
override fun equals(other: Any?) =
@@ -8,7 +8,7 @@ package kotlin.native.internal.test
internal class GTestLogger : TestLoggerWithStatistics() {
private val Collection<TestSuite>.totalTestsNotIgnored: Int
get() = asSequence().filter { !it.ignored }.sumBy { it.testCases.values.count { !it.ignored } }
get() = asSequence().filter { !it.ignored }.sumOf { it.testCases.values.count { !it.ignored } }
private val Collection<TestSuite>.totalNotIgnored: Int
get() = filter { !it.ignored }.size