From 3f0d763ce1d472e2d0a95e415604d9a521ed8c7a Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Sat, 18 Jan 2020 23:08:44 -0500 Subject: [PATCH] Opportunistic - suppress RedundantExplicitType --- .../com/squareup/moshi/kotlin/codegen/api/AdapterGenerator.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/AdapterGenerator.kt b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/AdapterGenerator.kt index 2f93040..64272f6 100644 --- a/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/AdapterGenerator.kt +++ b/kotlin/codegen/src/main/java/com/squareup/moshi/kotlin/codegen/api/AdapterGenerator.kt @@ -73,6 +73,9 @@ internal class AdapterGenerator( // Because we generate redundant `out` variance for some generics and there's no way // for us to know when it's redundant. "REDUNDANT_PROJECTION", + // Because we may generate redundant explicit types for local vars with default values. + // Example: 'var fooSet: Boolean = false' + "RedundantExplicitType", // NameAllocator will just add underscores to differentiate names, which Kotlin doesn't // like for stylistic reasons. "LocalVariableName"