I was surprised to find that this code compiles:
pure string Foo = SomePureFunction(123);
pure
is only mentioned in the context of functions in the online documentation.
What are pure
variables, and how are they different from immutable
and const
ones?
The attribute just has no effect in this case. It's a known issue in DMD, there are quite a number other similar cases, where attributes are not rejected, but don't have any effect as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With