Skip to content

Commit

Permalink
Let type mapper handle Map<*, *>
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Sep 7, 2023
1 parent 2728e94 commit df99e1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ class KotlinTypeSignatureBuilder(private val firSession: FirSession) : JavaTypeS
}
s.append(boundSigs)
s.append("}")
} else if (type is ConeCapturedType && type.lowerType == null) {
s.append("*")
} else {
throw IllegalArgumentException("Unsupported ConeTypeProjection " + type.javaClass.getName())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,4 +552,16 @@ class Inner
)
);
}

@Test
void coneProjection() {
rewriteRun(
kotlin(
"""
val map = mapOf(Pair("one", 1)) as? Map<*, *>
val s = map.orEmpty().entries.joinToString { (key, value) -> "$key: $value" }
"""
)
);
}
}

0 comments on commit df99e1c

Please sign in to comment.