File tree Expand file tree Collapse file tree
java/kotlin-extractor/src/main/kotlin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,12 @@ open class KotlinUsesExtractor(
9595 * `shortName` is a Java primitive name (e.g. "int"), a class short name with Java-style type arguments ("InnerClass<E>" or
9696 * "OuterClass<ConcreteArgument>" or "OtherClass<? extends Bound>") or an array ("componentShortName[]").
9797 */
98- data class TypeResult <out LabelType >(val id : Label <out LabelType >, val signature : String? , val shortName : String )
98+ data class TypeResult <out LabelType >(val id : Label <out LabelType >, val signature : String? , val shortName : String ) {
99+ fun <U > cast (): TypeResult <U > {
100+ @Suppress(" UNCHECKED_CAST" )
101+ return this as TypeResult <U >
102+ }
103+ }
99104 data class TypeResults (val javaResult : TypeResult <DbType >, val kotlinResult : TypeResult <DbKt_type >)
100105
101106 fun useType (t : IrType , context : TypeContext = TypeContext .OTHER ) =
@@ -871,8 +876,7 @@ open class KotlinUsesExtractor(
871876 val boundLabel = boundResults.javaResult.id.cast<DbReftype >()
872877
873878 return if (arg.variance == Variance .INVARIANT )
874- @Suppress(" UNCHECKED_CAST" )
875- boundResults.javaResult as TypeResult <DbReftype >
879+ boundResults.javaResult.cast<DbReftype >()
876880 else {
877881 val keyPrefix = if (arg.variance == Variance .IN_VARIANCE ) " super" else " extends"
878882 val wildcardKind = if (arg.variance == Variance .IN_VARIANCE ) 2 else 1
You can’t perform that action at this time.
0 commit comments