Fix code cleanups (#1441)

* Fix immutable properties

It was intentionally designed the previous way

* Restore limit in for loop

* Another ImmutableProperties
This commit is contained in:
Zac Sweers
2021-11-30 21:56:00 -05:00
committed by GitHub
parent 9f81ac897a
commit 751e8219e9
3 changed files with 9 additions and 3 deletions

View File

@@ -436,7 +436,10 @@ class GeneratedAdaptersTest {
}
@JsonClass(generateAdapter = true)
class ImmutableProperties(val a: Int, val b: Int)
class ImmutableProperties(a: Int, b: Int) {
val a = a
val b = b
}
@Test fun constructorDefaults() {
val moshi = Moshi.Builder().build()

View File

@@ -115,7 +115,10 @@ class KotlinJsonAdapterTest {
assertThat(decoded.b).isEqualTo(5)
}
class ImmutableProperties(val a: Int, val b: Int)
class ImmutableProperties(a: Int, b: Int) {
val a = a
val b = b
}
@Test fun constructorDefaults() {
val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()