[dmd-internals] Type mangling for deduced attributes

Don Clugston dclugston at googlemail.com
Thu Nov 17 03:01:01 PST 2011


On 17 November 2011 11:09, kenji hara <k.hara.pg at gmail.com> wrote:
> Withdraw a previous statement, I still argue that is better to apply
> result of inference into mangleof.
> First of all, the pure/safe/nothrow inference runs against only
> function literals and template functions.

This is true at present. But are we confident that it will never apply
to anything else?

> For function literal, its
> type determines in the place its written.For template function, its
> type determines in its instantiation.Both of cases can always see
> their function bodies.

Are we happy to say that when full type inference is used, it does NOT
invoke safe/pure/nothrow inference?

immutable fptr = &foo!(7);
immutable fptr2 = (){ return 0; }

That is, both fptr and fptr2 will always be impure, @system, and throw?
Or does it invoke safe/pure/nothrow inference? In which case the
situation I mentioned arises.


More information about the dmd-internals mailing list