Reserve simple type names referenced by properties to avoid collisions (#1305)

This commit is contained in:
Zac Sweers
2021-02-15 13:02:28 -05:00
committed by GitHub
parent 6b09dc443d
commit 99ebab66c0
3 changed files with 23 additions and 1 deletions

View File

@@ -1363,6 +1363,16 @@ class GeneratedAdaptersTest {
data class MultipleGenerics<A, B, C, D>(val prop: String)
}
// Regression test for https://github.com/square/moshi/issues/1277
// Compile-only test
@JsonClass(generateAdapter = true)
data class OtherTestModel(val TestModel: TestModel? = null)
@JsonClass(generateAdapter = true)
data class TestModel(
val someVariable: Int,
val anotherVariable: String
)
// Regression test for https://github.com/square/moshi/issues/1022
// Compile-only test
@JsonClass(generateAdapter = true)