[Issue 408] Template instance matching doesn't work sometimes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 16 10:13:48 PDT 2006


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





------- Comment #3 from burton-radons at smocky.com  2006-10-16 12:13 -------
It's not complaining about the outside template instantiation, it's complaining
about the nested one. In other words, 2 is treated happily as a uint by an
explicit instantiation, but is not treated as anything compatible to a uint by
a dependent instantiation.

This rule (which doesn't exist in the documentation) isn't even applied
consistently! This, which has EXACTLY the same issue as the first example,
works quite happily:

        struct S (float C)
        {
                void argh ()
                {
                        f! (C) (*this);
                }
        }

        template f (float C)
        {
                void f (S! (C) a)
                {
                }
        }

        alias S! (2) s;

Try to make a design of this and you'll come out with spagghetti, there's no
rhyme or reason to it.


-- 




More information about the Digitalmars-d-bugs mailing list