mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
Handle enclosing visibility + cache metadata parsing (#1026)
* Only allow public or internal classes * Ensure consistent ordering of supertypes * Eagerly load supertype typespecs for reuse * Add regression test for https://github.com/square/moshi/issues/1022 * Add MoshiCachedClassInspector, wire in * Check visibility of enclosed types too Resolves #1022 * Fix comments
This commit is contained in:
@@ -1171,6 +1171,20 @@ class GeneratedAdaptersTest {
|
||||
}
|
||||
}
|
||||
|
||||
// Regression test for https://github.com/square/moshi/issues/1022
|
||||
// Compile-only test
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class MismatchParentAndNestedClassVisibility(
|
||||
val type: Int,
|
||||
val name: String? = null
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class NestedClass(
|
||||
val nestedProperty: String
|
||||
)
|
||||
}
|
||||
|
||||
// Has to be outside to avoid Types seeing an owning class
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class NullableTypeParams<T>(
|
||||
|
Reference in New Issue
Block a user