NoSuchElementException when getting annotation arguments from FB's infer
See original GitHub issueIf we declare a dependency on FB’s Infer:
api("com.facebook.infer.annotation:infer-annotation:0.18.0")
And declare a class using an Infer annotations:
import com.facebook.infer.annotation.Nullsafe;
@Nullsafe(Nullsafe.Mode.STRICT)
public interface D {
}
And we try to get the information about the annotation used in the KSP processor:
(resolver
.getClassDeclarationByName("com.example.D")!!
.annotations.first().arguments[1].value!! as KSAnnotation)
.arguments
We get a NoSuchElementException
rather than the Set
we expect:
[ksp] java.util.NoSuchElementException: Collection is empty.
at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:592)
at com.google.devtools.ksp.symbol.impl.binary.KSAnnotationDescriptorImplKt.createKSValueArguments(KSAnnotationDescriptorImpl.kt:151)
at com.google.devtools.ksp.symbol.impl.binary.KSAnnotationDescriptorImpl$arguments$2.invoke(KSAnnotationDescriptorImpl.kt:88)
at com.google.devtools.ksp.symbol.impl.binary.KSAnnotationDescriptorImpl$arguments$2.invoke(KSAnnotationDescriptorImpl.kt:87)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.google.devtools.ksp.symbol.impl.binary.KSAnnotationDescriptorImpl.getArguments(KSAnnotationDescriptorImpl.kt:87)
at TestProcessor.process(TestProcessor.kt:24)
Kotlin version 1.6.10
KSP version 1.6.10-1.0.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
NoSuchElementException when getting a default argument of ...
I get the following error: e: [ksp] java.util.NoSuchElementException: Collection is empty. at kotlin.collections.
Read more >Bug List - Bugs - Eclipse
... NEW, ---, Java file, which is generated by annotation processor, is not compiled, 11:34:30 ... [infer type arguments] - StackOverflowError, 2022-09-03.
Read more >[Example code]-scrape the anglelist data - appsloveworld.com
I want to print the name of company list but it print nothing. score:-1. Accepted answer. import requests from selenium import webdriver from...
Read more >Untitled
Harry potter 2001 movie, Age of empires 3 how to get boneguard, Newmarket soccer centre ... Tomcat5.exe command line parameters, Hauschka or gano...
Read more >topAbbWordPair.txt - GitHub
... val value 31645 ns namespace 31474 a annotation 31335 gbc gridbagconstraints ... 3176 s sparse 3174 a argument 3173 str stream 3172...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
playground2.zip
I am having the same issue using
kotlinx.serialization
annotations. Classes annotated with@Serialized
is producing the same error stack trace