mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Kotlin: fix wildcard suppression where the annotation applies to a parent type/argument.
In the process I also fix the missed case where suppression can be switched off using a parameterized annotation.
This commit is contained in:
@@ -49,6 +49,9 @@ public class JavaUser {
|
||||
KotlinDefnsSuppressedFn kdsf = new KotlinDefnsSuppressedFn();
|
||||
kdsf.outerFn((List<CharSequence>)null, (Comparable<CharSequence>)null);
|
||||
|
||||
kd.takesVariantTypesIndirectlySuppressedWildcards((List<CharSequence>)null, (Comparable<CharSequence>)null);
|
||||
kd.takesVariantTypesComplexSuppressionWildcards((List<List<? extends List<? extends CharSequence>>>)null);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,10 @@ class KotlinDefns {
|
||||
|
||||
fun takesVariantTypesSuppressedWildcards(covar: List<@JvmSuppressWildcards CharSequence>, contravar: Comparable<@JvmSuppressWildcards CharSequence>) { }
|
||||
|
||||
fun takesVariantTypesIndirectlySuppressedWildcards(covar: @JvmSuppressWildcards List<CharSequence>, contravar: @JvmSuppressWildcards Comparable<CharSequence>) { }
|
||||
|
||||
fun takesVariantTypesComplexSuppressionWildcards(covar: @JvmSuppressWildcards(suppress = true) List<@JvmSuppressWildcards List<@JvmSuppressWildcards(suppress = false) List<CharSequence>>>) { }
|
||||
|
||||
fun returnsInvar() : MutableList<CharSequence> = mutableListOf()
|
||||
|
||||
fun returnsCovar(): List<CharSequence> = listOf()
|
||||
@@ -75,4 +79,4 @@ class KotlinDefnsSuppressedFn {
|
||||
|
||||
@JvmSuppressWildcards fun outerFn(covar: List<CharSequence>, contravar: Comparable<CharSequence>) { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
| KotlinDefns | takesNestedType | invar | List<List<CharSequence>> |
|
||||
| KotlinDefns | takesNestedType | mixed1 | List<? extends Comparable<? super CharSequence>> |
|
||||
| KotlinDefns | takesNestedType | mixed2 | Comparable<? super List<? extends CharSequence>> |
|
||||
| KotlinDefns | takesVariantTypesComplexSuppressionWildcards | covar | List<List<? extends List<? extends CharSequence>>> |
|
||||
| KotlinDefns | takesVariantTypesIndirectlySuppressedWildcards | contravar | Comparable<CharSequence> |
|
||||
| KotlinDefns | takesVariantTypesIndirectlySuppressedWildcards | covar | List<CharSequence> |
|
||||
| KotlinDefns | takesVariantTypesSuppressedWildcards | contravar | Comparable<CharSequence> |
|
||||
| KotlinDefns | takesVariantTypesSuppressedWildcards | covar | List<CharSequence> |
|
||||
| KotlinDefnsSuppressedFn | outerFn | contravar | Comparable<CharSequence> |
|
||||
|
||||
Reference in New Issue
Block a user