On 30.07.22 09:15, Salih Dincer wrote:
It's possible to do this because it's immutable. You don't need an extra update() function anyway.```d void main() { auto s = S("test A"); s.update = (_) { s.s = _; }; s.update("test B"); assert(s.s == "test B"); s.s = "test C"; assert(s.s == "test C"); } // No compile error... ```
You're not making sense. Your `s` is mutable, not immutable.