Use raw type for kclass references in dynamic invocation code gen (#911)

* Use raw type for kclass references in dynamic invocation code gen

Added a compile-only regression test
Resolves #905

* Make it actually generic

* Mostly fix generation

Will need to wait for inlined instantiation to merge

* Fix rebase issues and use newInstance
This commit is contained in:
Zac Sweers
2019-09-12 21:55:47 -04:00
committed by GitHub
parent dd0e3807d3
commit 1e541fc66c
2 changed files with 35 additions and 8 deletions

View File

@@ -47,6 +47,14 @@ data class TestClass(
val dynamicInlineOptional: Int = createInlineInt()
)
// Regression test for https://github.com/square/moshi/issues/905
// Just needs to compile
@JsonClass(generateAdapter = true)
data class GenericTestClassWithDefaults<T>(
val input: String = "",
val genericInput: T
)
private fun createInt(): Int {
return 3
}