Skip to content

Commit

Permalink
Suppress unchecked cast warning (GoogleContainerTools#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
etanshaul authored Nov 7, 2018
1 parent fe35ec7 commit 1966779
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ class ContainerToolsRule(private val testInstance: Any) : TestRule {
*/
private fun replaceServices() {
for (member in getMembersWithAnnotation(TestService::class)) {
// See https://youtrack.jetbrains.com/issue/KT-16432
@Suppress("UNCHECKED_CAST")
member as KProperty1<Any?, Any?>

member.isAccessible = true
val service: Any = member.get(testInstance)!!
setService(member.returnType.javaType.typeName, service)
Expand Down

0 comments on commit 1966779

Please sign in to comment.