[Issue 1604] Non-final method on final struct is too restrictive

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 11 03:13:39 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1604


brunodomedeiros+bugz at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brunodomedeiros+bugz at gmail.c
                   |                            |om




------- Comment #2 from brunodomedeiros+bugz at gmail.com  2008-09-11 05:13 -------
Yes, it seems to me that this is according to current const semantics, so it
would not be a rejects-invalid.

Is 'e' a struct or an object? (or any, doesn't matter?)
And... doesn't this sugestion introduce a fundamental hole in the const system?
How will the compiler know that the developer intended 'function' to not-change
just the rvalue of the 'e' param, instead of not-changing any of the
objects/data accessible by the 'e' param, which is what the traditional meaning
of const is (fully transitive).
And what if the source code for 'function' is not available at all?...

Perhaps it's time to revisit the ideia of allowing logical const...


-- 



More information about the Digitalmars-d-bugs mailing list