[dmd-beta] D2 2.058 alpha

Don Clugston dclugston at googlemail.com
Wed Feb 8 08:06:38 PST 2012


On 8 February 2012 16:31, David Simcha <dsimcha at gmail.com> wrote:
> Ok, I think I understand where you're coming from.  The intended use for
> this was to add member functions depending on the result of the static if,
> not member variables.  Adding member functions should in theory be legal,
> but figuring out whether an instantiation could add member functions is
> non-trivial and I think equivalent to the Halting Problem.

I mean X.tupleof shouldn't be defined, if X is not fully defined yet.

>
>
> On Wed, Feb 8, 2012 at 9:59 AM, Don Clugston <dclugston at googlemail.com>
> wrote:
>>
>> I don't think that should compile.  If there was anything inside the
>> 'static if' body, it'd be wrong code.
>> To me, that looks like an accepts-invalid bug that's been fixed.
>>
>> On 8 February 2012 14:56, David Simcha <dsimcha at gmail.com> wrote:
>> > On 2/8/2012 5:50 AM, Walter Bright wrote:
>> >>
>> >> http://ftp.digitalmars.com/dmd2beta.zip
>> >>
>> >> I'm calling it an alpha because we haven't resolved the associative
>> >> array
>> >> issue. But I want to see if there are any others before we do a
>> >> release.
>> >> _______________________________________________
>> >> dmd-beta mailing list
>> >> dmd-beta at puremagic.com
>> >> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>> >>
>> >
>> > Bug 7426 is still broken in cases that worked in 2.057.
>> >
>> > struct S {
>> >    static if(hasIndirections!(typeof(this))) {}
>> > }
>> >
>> > template hasIndirections(T)
>> > {
>> >    enum hasIndirections = hasIndirectionsImpl!(typeof(T.init.tupleof));
>> > }
>> >
>> > template hasIndirectionsImpl(T...)
>> > {
>> >    static if (!T.length)
>> >    {
>> >        enum hasIndirectionsImpl = false;
>> >    }
>> >    else
>> >    {
>> >        enum hasIndirectionsImpl = true;
>> >
>> >    }
>> > }
>> >
>> > _______________________________________________
>> > dmd-beta mailing list
>> > dmd-beta at puremagic.com
>> > http://lists.puremagic.com/mailman/listinfo/dmd-beta
>> _______________________________________________
>> dmd-beta mailing list
>> dmd-beta at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
>
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta


More information about the dmd-beta mailing list