[Issue 1182] Mixins scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 24 04:39:02 PDT 2007


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


aarti at interia.pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Comment #5 from aarti at interia.pl  2007-04-24 06:39 -------
Maybe I was not enough clear with my enhancement idea. I think that original
test case doesn't work because when compiler is mixing in template, it checks
if symbol 'policy' exists. According to specs when in current scope symbol
exists, symbol from mixin template should be dropped. It works good in general
case (and is really useful), but doesn't work in my example. When checking for
symbol compiler just doesn't check parameters of function and thinks that
symbol 'policy' is already there. If checking symbol could also include
checking parameters, method from template:

int policy() { return 1; }

could be normally inserted in the scope of TestClass. (But method T policy(int
i) { return T.init;} from template would be still droped, as it is *exactly*
same as in TestClass scope.)


-- 



More information about the Digitalmars-d-bugs mailing list