Skip to content

Commit 8b93c66

Browse files
committed
Update Kotlin to rc-1036
1 parent 8488479 commit 8b93c66

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

mockito-kotlin/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77

88
dependencies {
9-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-beta-4589"
9+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-rc-1036"
1010
}
1111
}
1212

@@ -16,13 +16,13 @@ repositories {
1616
}
1717

1818
dependencies {
19-
compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-4589"
20-
compile "org.jetbrains.kotlin:kotlin-reflect:1.0.0-beta-4589"
19+
compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.0-rc-1036"
20+
compile "org.jetbrains.kotlin:kotlin-reflect:1.0.0-rc-1036"
2121
compile "org.mockito:mockito-core:2.0.39-beta"
2222

2323
/* Tests */
2424
testCompile "junit:junit:4.12"
25-
testCompile "com.nhaarman:expect.kt:0.3.0"
25+
testCompile "com.nhaarman:expect.kt:0.4.0"
2626
}
2727

2828
publishing {

mockito-kotlin/src/main/kotlin/com/nhaarman/mockito_kotlin/CreateInstance.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private fun KClass<*>.isPrimitive() =
7676
"String"
7777
)
7878

79-
@Suppress("UNCHECKED_CAST", "IMPLICIT_CAST_TO_UNIT_OR_ANY")
79+
@Suppress("UNCHECKED_CAST", "IMPLICIT_CAST_TO_ANY")
8080
private fun <T : Any> KClass<T>.toDefaultPrimitiveValue(): T {
8181
return when (simpleName) {
8282
"Boolean" -> true
@@ -91,7 +91,7 @@ private fun <T : Any> KClass<T>.toDefaultPrimitiveValue(): T {
9191
} as T
9292
}
9393

94-
@Suppress("UNCHECKED_CAST", "IMPLICIT_CAST_TO_UNIT_OR_ANY")
94+
@Suppress("UNCHECKED_CAST", "IMPLICIT_CAST_TO_ANY")
9595
private fun <T : Any> KClass<T>.toArrayInstance(): T {
9696
return when (simpleName) {
9797
"ByteArray" -> byteArrayOf()
@@ -106,7 +106,7 @@ private fun <T : Any> KClass<T>.toArrayInstance(): T {
106106

107107
private fun <T : Any> KFunction<T>.newInstance(): T {
108108
isAccessible = true
109-
return callBy(parameters.toMap {
109+
return callBy(parameters.associate {
110110
it to it.type.createNullableInstance<T>()
111111
})
112112
}
@@ -130,7 +130,7 @@ private fun <T : Any> KType.createNullableInstance(): T? {
130130
*/
131131
@Suppress("UNCHECKED_CAST")
132132
private fun <T> Class<T>.uncheckedMock(): T {
133-
val impl = MockSettingsImpl<T>().defaultAnswer(Answers.RETURNS_DEFAULTS) as MockSettingsImpl<*>
133+
val impl = MockSettingsImpl<T>().defaultAnswer(Answers.RETURNS_DEFAULTS) as MockSettingsImpl<T>
134134
val creationSettings = impl.confirm(this)
135-
return MockUtil().createMock(creationSettings) as T
135+
return MockUtil().createMock(creationSettings)
136136
}

0 commit comments

Comments
 (0)