On 16 November 2011 03:23, kenji hara <[email protected]> wrote: > 2011/9/4 Walter Bright <[email protected]>: >> >> >> On 9/3/2011 5:56 PM, Martin Nowak wrote: >>> >>> I've stumbled over the fact that deduced function attributes (pure, >>> nothrow) are not reflected >>> in the name mangling. Is this a bug or by design? >>> >> >> It is by design. I think that's the right choice, but I'm not positive. > > I think .mangleof property should return the actual value (based on > the real type). > Otherwise, we cannot guarantee the pure/nothrow/safe attributes in ABI level.
That's intentional. If it is only *deduced* to be pure/nothrow/safe, then external functions, which don't have access to the source, can NOT rely on it being pure/nothrow/safe. I think this is the right choice. Suppose I want to declare a stub function. At the moment, because it's just a stub, it isn't impure or unsafe, but I know that when it is fully implemented, it will be impure and unsafe, and may throw. The deduction should not be giving additional guarantees to external code. It should be conservative. _______________________________________________ dmd-internals mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/dmd-internals
