https://kotlinlang.org logo
Title
j

jschneider

01/23/2018, 10:41 PM
I get a "Type mismatch". It is expecting String instead of String? But can't understand why
j

jo

01/23/2018, 10:49 PM
It could be the code is annotated with @NotNull or something like that. Would be strange, given the name, but that's my suspicion. String? Is a nullable string type.
j

jschneider

01/23/2018, 11:22 PM
The parameter is not annotated (it is from Guava). The other parameters are. Maybe there is now a package wide NonNull annotation... I will take a look.
j

jo

01/24/2018, 1:03 AM
If nothing else, changing "String?" to "String" will guarantee that it's not null and will thus make the call to that method unnecessary.