You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Parameter processing desn't work if a project contains data classes
To Reproduce
Create a plugin that handles parameters
class MyParameterPlugin : Meta {
@ExperimentalContracts
override fun intercept(ctx: CompilerContext) = listOf(parameterPlugin)
}
val Meta.parameterPlugin
get() = "Parameter plugin" {
meta(
parameter(this, { true }) { parameter ->
Transform.replace(
replacing = parameter,
newDeclaration = identity()
)
}
)
}
Crete a sample project containing data classes, eg:
data class User(val name: String)
Try to build the sample project using the plugin from step 1.
Result:
> Task :compileKotlin FAILED
e: java.lang.IllegalStateException: Unrecognized expression type from VALUE_PARAMETER
at arrow.meta.internal.kastree.ast.psi.Converter.convertExpr(Converter.kt:385)
at arrow.meta.internal.kastree.ast.psi.ConverterKt.getAst(Converter.kt:946)
at arrow.meta.quotes.QuoteKt$replace$1.invoke(Quote.kt:345)
at arrow.meta.quotes.QuoteKt$replace$1.invoke(Quote.kt)
at arrow.meta.internal.kastree.ast.MutableVisitor$Companion$preVisit$1.preVisit(MutableVisitor.kt:347)
at arrow.meta.internal.kastree.ast.MutableVisitor$visit$$inlined$run$lambda$1.invoke(MutableVisitor.kt:10)
at arrow.meta.internal.kastree.ast.MutableVisitor$visit$$inlined$run$lambda$1.invoke(MutableVisitor.kt:3)
at arrow.meta.internal.kastree.ast.MutableVisitor$ChangedRef.sub(MutableVisitor.kt:341)
at arrow.meta.internal.kastree.ast.MutableVisitor.visit(MutableVisitor.kt:9)
at arrow.meta.internal.kastree.ast.MutableVisitor.visit$default(MutableVisitor.kt:8)
at arrow.meta.internal.kastree.ast.MutableVisitor$Companion.preVisit(MutableVisitor.kt:348)
at arrow.meta.quotes.QuoteKt.replace(Quote.kt:344)
at arrow.meta.quotes.QuoteKt.replace$default(Quote.kt:344)
at arrow.meta.quotes.MetaExtensionsKt$parameter$$inlined$quote$1$1.invoke(Quote.kt:469)
at arrow.meta.quotes.MetaExtensionsKt$parameter$$inlined$quote$1$1.invoke(Quote.kt)
at arrow.meta.dsl.analysis.AnalysisSyntax$analysis$1.doAnalysis(AnalysisSyntax.kt:66)
at arrow.meta.internal.registry.InternalRegistry$registerAnalysisHandler$1$1.doAnalysis(InternalRegistry.kt:515)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:116)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:93)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:526)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:90)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:517)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:185)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:164)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:51)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:86)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:346)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:102)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:240)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:39)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:81)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:93)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:601)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:93)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1633)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Expected behavior
Compilation should be successful.
Describe the bug
Parameter processing desn't work if a project contains data classes
To Reproduce
Result:
Expected behavior
Compilation should be successful.
Environment:
Additional context
Meta.parameterPlugin
has successfully processed the sources.Meta.property()
instead ofMeta.parameter()
, the code builds and runs fine (but I needparameter
).1.3.61-SNAPSHOT
instead of1.4.10-SNAPSHOT
, compilation fails on registering meta components.The text was updated successfully, but these errors were encountered: