← Docs
kotlin.test / kotlin.test / assertIsNot

assertIsNot

Common
JVM
JS
Native
1.5
fun < reified T > assertIsNot (
value : Any ? ,
message : String ? = null
) : Unit

(source)

Asserts that value is not of type T , with an optional message .

Note that due to type erasure the type check may be partial (e.g. assertIsNot<List<String>>(value) only checks for the class being List and not the type of its elements because it's erased).

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .