Looking at the <assign operator overload> KEEP, I ...
# language-evolution
y
Looking at the assign operator overload KEEP, I see mentions of a new compiler plugin that implements the corresponding feature, but I can't seem to find it anywhere. Is that compiler plugin out yet?
e
Gradle 8.1 is already using it, so yes, it is out
y
Any more info though like do I need an IDE plugin to make sure it doesn't scream at me?
e
it works similar to the other standard compiler plugins, use the
assignment { annotations(...) }
extension in Gradle, source is all available https://github.com/JetBrains/kotlin/tree/master/libraries/tools/kotlin-assignment
no IDE support AFAIK
a
I’ve been using assignment overloading in a hobby project, it’s fun! I wrote a q&a on how to use it here, and some of the restrictions I haven’t noticed any problems with IntelliJ, it just works https://stackoverflow.com/q/76022932/4161471
a
cool, thanks @ephemient
y
Kind of a bummer that they're only for member properties. I was hoping to use it on a Vec4 type to assign one vector to another by copying its components. I don't imagine that that's a compiler limitation, but rather an artificial one. Could be interesting to see if they would ever lift that.