Open sorokod opened 1 week ago
It should indeed be fixed but unfortunately we can't. It's a language limitation.
Have you tried making a function like operator fun String.plus(something)
?
Since
String
already has a function plus
, an extension function overload will never be called by default.
I would consider deprecating, and ultimately removing:
public operator fun ColumnReference<String>.plus
.
Might indeed be a good idea to add ColumReference<String>.append()
and .prepend()
or something similar and through deprecations steer users to those :)
We still cannot prevent "" + anything
from becoming a String
though
Sample code (version 0.12.0):
The first println (
name + "!!!"
) produces:The second println (
"!!!" + name
) produces:The root cause is that In the two example
+
resolves to different functions. A foot gun that should be fixed.