Support configuring of nullability annotations with their report levels through a test directive

This commit is contained in:
Victor Petukhov
2021-06-02 17:21:42 +03:00
parent 61c2f1b203
commit 6d3badb2cd
8 changed files with 237 additions and 2 deletions
@@ -180,4 +180,11 @@ class JavaTypeEnhancementStateParser(private val collector: MessageCollector) {
return FqName(name) to state
}
companion object {
private val DEFAULT = JavaTypeEnhancementStateParser(MessageCollector.NONE)
fun parsePlainNullabilityAnnotationReportLevels(nullabilityAnnotations: String) =
DEFAULT.parseNullabilityAnnotationReportLevels(arrayOf(nullabilityAnnotations)).entries.singleOrNull()?.toPair()
}
}