www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Interface member types are perceived as properties

reply "Matthew Wilson" <dmd synesis.com.au> writes:
e.g.

interface IContainer
{
    . . .

    Class Container
        : public IContainer
    {
        . . .
    }

    alias Container selected_type;

    // static selecting_type   hack;

}


. .  .

template BaseSelector(T)
{
//    alias   typeof(T.hack) selected_type;
 alias T.selected_type  selected_type;
}


I have to use the commented "hack" lines.
Jul 14 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Matthew Wilson" <dmd synesis.com.au> wrote in message
news:cd4ugj$1hpi$1 digitaldaemon.com...
 e.g.

 interface IContainer
 {
     . . .

     Class Container
         : public IContainer
     {
         . . .
     }

     alias Container selected_type;

     // static selecting_type   hack;

 }


 . .  .

 template BaseSelector(T)
 {
 //    alias   typeof(T.hack) selected_type;
  alias T.selected_type  selected_type;
 }


 I have to use the commented "hack" lines.
I really need a compilable example. Exactly how are you instantiating BaseSelector? The reason I always ask for complete examples is I cannot count the number of times I've mocked up an example based on the complaint's description, only to find that it works fine. There was something else causing the problem that wasn't mentioned in the description that the person assumed was irrelevant.
Jul 16 2004
parent reply "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
Sure. Let me try and come up with one.


"Walter" <newshound digitalmars.com> wrote in message
news:cda8hs$ssu$1 digitaldaemon.com...
 "Matthew Wilson" <dmd synesis.com.au> wrote in message
 news:cd4ugj$1hpi$1 digitaldaemon.com...
 e.g.

 interface IContainer
 {
     . . .

     Class Container
         : public IContainer
     {
         . . .
     }

     alias Container selected_type;

     // static selecting_type   hack;

 }


 . .  .

 template BaseSelector(T)
 {
 //    alias   typeof(T.hack) selected_type;
  alias T.selected_type  selected_type;
 }


 I have to use the commented "hack" lines.
I really need a compilable example. Exactly how are you instantiating BaseSelector? The reason I always ask for complete examples is I cannot count the number of times I've mocked up an example based on the complaint's description, only to find that it works fine. There was something else causing the problem that wasn't mentioned in the description that the person assumed was irrelevant.
Jul 16 2004
parent "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
I'm working too fast. I already submitted one of these, under the "Aliases not
passed down to child classes" thread.


"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
news:cdad52$uvj$1 digitaldaemon.com...
 Sure. Let me try and come up with one.


 "Walter" <newshound digitalmars.com> wrote in message
 news:cda8hs$ssu$1 digitaldaemon.com...
 "Matthew Wilson" <dmd synesis.com.au> wrote in message
 news:cd4ugj$1hpi$1 digitaldaemon.com...
 e.g.

 interface IContainer
 {
     . . .

     Class Container
         : public IContainer
     {
         . . .
     }

     alias Container selected_type;

     // static selecting_type   hack;

 }


 . .  .

 template BaseSelector(T)
 {
 //    alias   typeof(T.hack) selected_type;
  alias T.selected_type  selected_type;
 }


 I have to use the commented "hack" lines.
I really need a compilable example. Exactly how are you instantiating BaseSelector? The reason I always ask for complete examples is I cannot count the number of times I've mocked up an example based on the complaint's description, only to find that it works fine. There was something else causing the problem that wasn't mentioned in the description that the person assumed was irrelevant.
Jul 16 2004