Commit e1de1f6
Micah Zoltu
Makes
Since `Mockito.mock` is a Java function it returns a Kotlin platform type. By adding an explicit return type to the wrapper, the kotlin version of `mock` will now return a non-platform type. In this case, we know that `Mockito.mock` doesn't return null so we can safely make the wrapper return a non-null type. We add the `!!` to make it clear to the reader our intent is to strip the platform type at this point, and also make the Kotlin compiler add an explicit null-check "just in case" before returning from the kotlin `mock` method.mock return non-null types.1 parent bb4ac76 commit e1de1f6
File tree
1 file changed
+5
-5
lines changed- mockito-kotlin/src/main/kotlin/com/nhaarman/mockito_kotlin
1 file changed
+5
-5
lines changedLines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
0 commit comments