Trying to use spring mail, I get a compiler warnin...
# spring
i
Trying to use spring mail, I get a compiler warning that I don't understand. My service contains the following function which wraps sending a SimpleMailMessage:
Copy code
fun sendSimpleMessage(
        op: SimpleMailMessage.() -> Unit
) {
    val message = SimpleMailMessage().apply(op)
    mailSender.send(message)
}
A part of the MailMessage interface is the method:
Copy code
public void setSubject(String subject)
So now on the calling site I have
Copy code
mail.sendSimpleMessage {
    setTo(address)
    subject = "Test Email" // compiler warning
    //setSubject("Test Email") <--- this does work though
    ....
}
And the comp0iler says:
Val cannot be reassigned
But this isn't a val - the compiler should translate it to setSubject - thats also what the IDE suggests (ctrl-click brings me to the interface method) I don't understand, what the compiler thinks that 'subject' is supposed to be .... certainly not a val, since this shouldn't be kotlin code Any hints what could be going on there?