File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
core/src/main/java/com/google/common/truth Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,15 @@ public final void isNotSameInstanceAs(@Nullable Object other) {
289
289
}
290
290
}
291
291
292
- /** Checks that the value under test is an instance of the given class. */
292
+ /**
293
+ * Checks that the value under test is an instance of the given class.
294
+ *
295
+ * <p>Kotlin users: A call to {@code assertThat(foo).isInstanceOf(Bar::class.java)} does not
296
+ * perform a smart cast on {@code foo}. If you require a smart cast, consider using {@code foo as
297
+ * Bar} or {@code assertIs<Bar>(foo)} instead. The tradeoffs are that those will look different
298
+ * than any surrounding Truth assertions and that they will produce worse failure messages (for
299
+ * example, by not including the actual value, only its type).
300
+ */
293
301
public void isInstanceOf (@ Nullable Class <?> clazz ) {
294
302
if (clazz == null ) {
295
303
failWithoutActual (
You can’t perform that action at this time.
0 commit comments