We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test case:
open class FruitStore<T> { var storage: List<T>? = null var id: Int = 0 } @JsonClass(generateAdapter = true) class OrangeStore : FruitStore<Orange>() class Orange(val price: Int)
using moshi codegen 1.14.0 when process class OrangeStore which super class contains List generic type , I got this error, stack trace like below:
[ksp] Error preparing OrangeStore: com.squareup.moshi.kotlin.codegen.api.AdapterGenerator$generateType$typeRenderer$1.renderTypeVariable(AdapterGenerator.kt:262) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render(TypeRenderer.kt:106) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render$default(TypeRenderer.kt:43) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.renderObjectType(TypeRenderer.kt:116) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render(TypeRenderer.kt:79) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render$default(TypeRenderer.kt:43) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.renderObjectType(TypeRenderer.kt:116) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render(TypeRenderer.kt:48) com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render$default(TypeRenderer.kt:43) com.squareup.moshi.kotlin.codegen.api.DelegateKey.generateProperty$codegen(DelegateKey.kt:62) com.squareup.moshi.kotlin.codegen.api.AdapterGenerator.generateType(AdapterGenerator.kt:270) com.squareup.moshi.kotlin.codegen.api.AdapterGenerator.prepare(AdapterGenerator.kt:183) com.squareup.moshi.kotlin.codegen.ksp.JsonClassSymbolProcessor.process(JsonClassSymbolProcessorProvider.kt:94) com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:237) com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:235) com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:330) com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:235) org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:123) org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:99) org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:264) org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:55) org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115) org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:255) org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:101) org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:60) org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:157) org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52) org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:94) org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43) org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1642) jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.base/java.lang.reflect.Method.invoke(Unknown Source) java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source) java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source) java.base/java.security.AccessController.doPrivileged(Unknown Source) java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source) java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source) java.base/java.security.AccessController.doPrivileged(Unknown Source) java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.base/java.lang.Thread.run(Unknown Source)
while directly declare FruitStore generic type without list like below, everything works fine.
open class FruitStore<T> { var storage: T? = null var id: Int = 0 }
The text was updated successfully, but these errors were encountered:
Fix square#1729. Properly handle type resolving for type parameters.
84f0e9e
c9e0aa2
Successfully merging a pull request may close this issue.
test case:
using moshi codegen 1.14.0
when process class OrangeStore which super class contains List generic type , I got this error, stack trace like below:
[ksp] Error preparing OrangeStore: com.squareup.moshi.kotlin.codegen.api.AdapterGenerator$generateType$typeRenderer$1.renderTypeVariable(AdapterGenerator.kt:262)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render(TypeRenderer.kt:106)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render$default(TypeRenderer.kt:43)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.renderObjectType(TypeRenderer.kt:116)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render(TypeRenderer.kt:79)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render$default(TypeRenderer.kt:43)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.renderObjectType(TypeRenderer.kt:116)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render(TypeRenderer.kt:48)
com.squareup.moshi.kotlin.codegen.api.TypeRenderer.render$default(TypeRenderer.kt:43)
com.squareup.moshi.kotlin.codegen.api.DelegateKey.generateProperty$codegen(DelegateKey.kt:62)
com.squareup.moshi.kotlin.codegen.api.AdapterGenerator.generateType(AdapterGenerator.kt:270)
com.squareup.moshi.kotlin.codegen.api.AdapterGenerator.prepare(AdapterGenerator.kt:183)
com.squareup.moshi.kotlin.codegen.ksp.JsonClassSymbolProcessor.process(JsonClassSymbolProcessorProvider.kt:94)
com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:237)
com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:235)
com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:330)
com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:235)
org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:123)
org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:99)
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:264)
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:55)
org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:255)
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:101)
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:60)
org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:157)
org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:94)
org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1642)
jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.base/java.lang.reflect.Method.invoke(Unknown Source)
java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
java.base/java.security.AccessController.doPrivileged(Unknown Source)
java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
java.base/java.security.AccessController.doPrivileged(Unknown Source)
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.base/java.lang.Thread.run(Unknown Source)
while directly declare FruitStore generic type without list like below, everything works fine.
The text was updated successfully, but these errors were encountered: