Dear IntelliJ devs, just came here to say thank yo...
# intellij
e
Dear IntelliJ devs, just came here to say thank you for saving me from silent bugs with this inspection kodee loving
👍 4
kodee loving 3
k
That's a very useful inspection! But you can eliminate bugs like these by using
inline
classes
Name
and
Type
instead of
String
.
e
Indeed. In this case, though, I need to convert these down to strings because they are used for code generation, so I wonder if that would help. For example:
Copy code
value class Name(private val string: String) {
    override fun toString() = string
}

// ...

val (type, name) = field

appendLine("val $name: $type") // Same problem?
I think the only way alternative to keep the code short and avoid the bug would be to use `with`/`run`…