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
Having a comment on the same line as an annotation causes an IllegalStateException, if an overridden property is annotated
interfaceFruit {
val weight:Int
}
classBanana: Fruit {
@Deprecated("causes exception") // evil commentoverrideval weight:Int=120
@Deprecated("this works") // tame commentval color:String="green"
}
The resulting stacktrace is
java.lang.IllegalStateException: Unrecognized modifier: // evil comment
at arrow.meta.internal.kastree.ast.psi.Converter$convertModifiers$1.invoke(Converter.kt:468)
at arrow.meta.internal.kastree.ast.psi.Converter$convertModifiers$1.invoke(Converter.kt:453)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786)
at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:816)
at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:807)
at arrow.meta.internal.kastree.ast.psi.Converter.convertModifiers(Converter.kt:472)
at arrow.meta.internal.kastree.ast.psi.Converter.convertModifiers(Converter.kt:451)
at arrow.meta.internal.kastree.ast.psi.Converter.convertProperty(Converter.kt:524)
at arrow.meta.internal.kastree.ast.psi.Converter.convertDecl(Converter.kt:295)
at arrow.meta.internal.kastree.ast.psi.Converter.convertClassBody(Converter.kt:805)
at arrow.meta.internal.kastree.ast.psi.Converter.convertStructured(Converter.kt:627)
at arrow.meta.internal.kastree.ast.psi.Converter.convertDecl(Converter.kt:291)
at arrow.meta.internal.kastree.ast.psi.Converter.convertFile(Converter.kt:393)
at arrow.meta.internal.kastree.ast.psi.Converter.convertFile$default(Converter.kt:388)
at arrow.meta.quotes.MetaExtensionsKt$classDeclaration$$inlined$quote$1$1.invoke(Quote.kt:289)
at arrow.meta.quotes.MetaExtensionsKt$classDeclaration$$inlined$quote$1$1.invoke(Quote.kt:152)
at arrow.meta.dsl.analysis.AnalysisSyntax$analysis$1.doAnalysis(AnalysisSyntax.kt:66)
at arrow.meta.internal.registry.InternalRegistry$registerAnalysisHandler$1$1.doAnalysis(InternalRegistry.kt:529)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:119)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:85)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:514)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:505)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:112)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:505)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:189)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:155)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
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:386)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:110)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:303)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:99)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:124)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:74)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:607)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1659)
at jdk.internal.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
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(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
The same (similar?) error seems to happen if a class has multiple annotations and any but the first one is annotated:
This works
// tame comment
@TestMethodOrder(MethodOrderer.Alphanumeric::class)
@ExtendWith(CorrectTestReportingExtension::class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
internalclassMyTest {
}
Describe the bug
Having a comment on the same line as an annotation causes an
IllegalStateException
, if an overridden property is annotatedThe resulting stacktrace is
The same (similar?) error seems to happen if a class has multiple annotations and any but the first one is annotated:
This works
this does not
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: