Browse Source

Fix compiler warnings

Him188 3 years ago
parent
commit
f962618bee

+ 1 - 1
mirai-console/tools/intellij-plugin/src/wizard/MiraiModuleBuilder.kt

@@ -55,7 +55,7 @@ class MiraiModuleBuilder : StarterModuleBuilder() {
 
 
     override fun createWizardSteps(
-        wizardContext: WizardContext,
+        context: WizardContext,
         modulesProvider: ModulesProvider
     ): Array<ModuleWizardStep> = emptyArray()
 

+ 3 - 3
mirai-core-utils/src/commonMain/kotlin/ByteArrayOp.kt

@@ -90,7 +90,7 @@ public expect fun GzipDecompressionInput(source: Input): Input
 /**
  * @see GzipDecompressionInput
  */
-public inline fun Input.gzipDecompressionInput(): Input = GzipDecompressionInput(this)
+public fun Input.gzipDecompressionInput(): Input = GzipDecompressionInput(this)
 
 /**
  * [source] will be closed on returned [Input.close]
@@ -101,7 +101,7 @@ public expect fun InflateInput(source: Input): Input
 /**
  * @see InflateInput
  */
-public inline fun Input.inflateInput(): Input = InflateInput(this)
+public fun Input.inflateInput(): Input = InflateInput(this)
 
 /**
  * [source] will be closed on returned [Input.close]
@@ -112,4 +112,4 @@ public expect fun DeflateInput(source: Input): Input
 /**
  * @see DeflateInput
  */
-public inline fun Input.deflateInput(): Input = DeflateInput(this)
+public fun Input.deflateInput(): Input = DeflateInput(this)

+ 1 - 0
mirai-core-utils/src/mingwX64Test/kotlin/MiraiFileImplTest.kt

@@ -25,6 +25,7 @@ internal class WindowsMiraiFileImplTest : AbstractNativeMiraiFileImplTest() {
         super.parent()
     }
 
+    @Test
     override fun `canonical paths for non-canonical input`() {
         super.`canonical paths for non-canonical input`()
 

+ 1 - 0
mirai-core-utils/src/unixTest/kotlin/UnixMiraiFileImplTest.kt

@@ -28,6 +28,7 @@ internal class UnixMiraiFileImplTest : AbstractNativeMiraiFileImplTest() {
         super.parent()
     }
 
+    @Test
     override fun `canonical paths for non-canonical input`() {
         super.`canonical paths for non-canonical input`()
 

+ 1 - 0
mirai-core/src/commonMain/kotlin/message/data/FileMessageImpl.kt

@@ -35,6 +35,7 @@ internal fun FileMessage.checkIsImpl(): FileMessageImpl {
 }
 
 @Serializable
+@Suppress("ANNOTATION_ARGUMENT_MUST_BE_CONST") // bug
 @SerialName(FileMessage.SERIAL_NAME)
 internal data class FileMessageImpl(
     override val id: String,

+ 0 - 13
mirai-core/src/commonTest/kotlin/message/data/MessageRefineTest.kt

@@ -43,8 +43,6 @@ open class TM(private val name: String = Random.nextInt().toString()) : SingleMe
         if (this === other) return true
         if (!isSameType(this, other)) return false
 
-        other as TM
-
         if (name != other.name) return false
 
         return true
@@ -74,17 +72,6 @@ private fun testRefineLight(
 ) = assertEquals(after.toMessageChain(), before.toMessageChain().refineLight(bot))
 
 
-@Suppress("TestFunctionName")
-private fun RefinableMessage(
-    refine: (bot: Bot, context: MessageChain) -> Message?
-): RefinableMessage {
-    return object : RefinableMessage, TM() {
-        override fun tryRefine(bot: Bot, context: MessageChain, refineContext: RefineContext): Message? {
-            return refine(bot, context)
-        }
-    }
-}
-
 @Suppress("TestFunctionName")
 private fun RefinableMessage0(
     refine: () -> Message?

+ 1 - 2
mirai-core/src/jvmBaseMain/kotlin/contact/GroupImpl.kt

@@ -15,7 +15,6 @@ import net.mamoe.mirai.data.GroupInfo
 import net.mamoe.mirai.internal.QQAndroidBot
 import net.mamoe.mirai.internal.utils.RemoteFileImpl
 import net.mamoe.mirai.utils.DeprecatedSinceMirai
-import net.mamoe.mirai.utils.RemoteFile
 import kotlin.coroutines.CoroutineContext
 
 internal actual class GroupImpl actual constructor(
@@ -30,5 +29,5 @@ internal actual class GroupImpl actual constructor(
     @Suppress("DEPRECATION")
     @Deprecated("Please use files instead.", replaceWith = ReplaceWith("files.root"), level = DeprecationLevel.WARNING)
     @DeprecatedSinceMirai(warningSince = "2.8")
-    override val filesRoot: RemoteFile by lazy { RemoteFileImpl(this, "/") }
+    override val filesRoot: net.mamoe.mirai.utils.RemoteFile by lazy { RemoteFileImpl(this, "/") }
 }

+ 4 - 3
mirai-core/src/nativeTest/kotlin/testFramework/DebugProbes.kt

@@ -12,15 +12,16 @@ package net.mamoe.mirai.internal.testFramework
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Job
 
+@Suppress("UNUSED_PARAMETER", "unused")
 internal actual object DebugProbes {
 
     /**
-     * Prints [job] hierarchy representation from [jobToString] to the given [out].
+     * Prints  hierarchy representation from [jobToString] to the given .
      */
 //    public fun printJob(job: Job, out: PrintStream = System.out): Unit
 
     /**
-     * Prints all coroutines launched within the given [scope].
+     * Prints all coroutines launched within the given .
      * Throws [IllegalStateException] if the scope has no a job in it.
      */
 //    public fun printScope(scope: CoroutineScope, out: PrintStream = System.out): Unit
@@ -113,7 +114,7 @@ internal actual object DebugProbes {
     }
 
     /**
-     * Prints [job] hierarchy representation from [jobToString] to the given [out].
+     * Prints [job] hierarchy representation from [jobToString] to the given .
      */
     actual fun printJob(job: Job) {
     }