You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: here we have exactly the old issue of type as above. Maybe a common method that can be called to get the correct one? or do we maybe have to check both null and not null types here?
val arguments = function.valueParameters.map { argument ->
176
171
val argumentName = argument.name
177
-
// about argument.type: regular Kotlin types are marked T or T?, but types from Java are (T..T?) because nullability cannot be decided.
178
-
// Therefore we have to unpack in case we have the Java type. Fortunately, the Java types are not marked nullable, so we default to non nullable types. Let the user decide if they want nullable types instead. With this implementation Kotlin types also keeps their nullability
179
-
val argumentType = argument.type.unwrap().makeNullableAsSpecified(argument.type.isMarkedNullable)
172
+
val argumentType = argument.type.unwrappedType()
180
173
181
174
"$argumentName: $argumentType"
182
175
}.joinToString(", ")
183
-
val returnType = function.returnType?.unwrap()?.makeNullableAsSpecified(function.returnType?.isMarkedNullable ?:false)?.toString()
176
+
val returnType = function.returnType?.unwrappedType()?.toString()?.takeIf { "Unit"!= it }
184
177
185
-
return"override fun $name($arguments)${returnType?.takeIf { "Unit"!= it }?.let { ": $it" } ?:""} { }"
178
+
return"override fun $name($arguments)${returnType?.let { ": $it" } ?:""} { }"
186
179
}
187
180
181
+
// about types: regular Kotlin types are marked T or T?, but types from Java are (T..T?) because nullability cannot be decided.
182
+
// Therefore we have to unpack in case we have the Java type. Fortunately, the Java types are not marked nullable, so we default to non nullable types. Let the user decide if they want nullable types instead. With this implementation Kotlin types also keeps their nullability
0 commit comments