Not 100% sure where to ask this but out of curiosi...
# intellij
m
Not 100% sure where to ask this but out of curiosity, is there a compiler plugin or IDE plugin that can tell me when I pass wrong positional arguments to
String.format
?
Copy code
// I'd like this to fail at compile time and/or show me an error in the IDE
String.format("%d", "10")
k
Interestingly, it already does, but only for Java files.
👀 1
👍 1
blob thinking upside down 1
m
Ah thanks! I thought I'd seen this somewhere
But haven't been able to make it work in Kotlin files so far
e
I think Android lint does same for the Android strings
👍 1
t
what happens if you use the Kotlin syntax?
"%d".format(10)
?
m
@twisterrob same thing (i.e. no warning/error)
e
m
Good find, upvoted!