Thread overview
DMD 141 ~ Templates, and member visibility errors
Dec 18, 2005
Kris
Dec 18, 2005
Kris
Dec 18, 2005
Thomas Kuehne
December 18, 2005
class FooTemplate(T) : BarTemplate!(T)
{
}

class BarTemplate(T) : Wumpus
{
        this (){ff=false;}
}

class Wumpus
{
        private bool ff;
}

void main()
{
        auto f = new FooTemplate!(char);
}


#  class str.BarTemplate!(char).BarTemplate member ff is not accessible


It's all in the same module, so 'ff' should be visible. Also have cases where 'protected' exhibits similar behavior ~ had to use "package" there to get visibility within a subclass, although everthing is in one module.

Also have a bizzare situation whereby the implementation of an abstract base-class is being recognized or ignored, depending on the order of the methods within the class. Tried to whittle that one down, but it wouldn't trip in a small test case. See here for the code where that particular problem exists: http://trac.dsource.org/projects/mango/browser/trunk/mango/text/String.d

Line 687 describes the base-class issue (the culprit method is at line 1209), and line 703 illustrates the visibility issue (should be protected but apparently cannot be).


December 18, 2005
Uhh, sorry. Here's a link where the noted line numbers will match: http://trac.dsource.org/projects/mango/browser/trunk/mango/text/String.d?rev=671



"Kris" <fu@bar.com> wrote in message news:do2bam$2ab0$1@digitaldaemon.com...
> class FooTemplate(T) : BarTemplate!(T)
> {
> }
>
> class BarTemplate(T) : Wumpus
> {
>        this (){ff=false;}
> }
>
> class Wumpus
> {
>        private bool ff;
> }
>
> void main()
> {
>        auto f = new FooTemplate!(char);
> }
>
>
> #  class str.BarTemplate!(char).BarTemplate member ff is not accessible
>
>
> It's all in the same module, so 'ff' should be visible. Also have cases where 'protected' exhibits similar behavior ~ had to use "package" there to get visibility within a subclass, although everthing is in one module.
>
> Also have a bizzare situation whereby the implementation of an abstract base-class is being recognized or ignored, depending on the order of the methods within the class. Tried to whittle that one down, but it wouldn't trip in a small test case. See here for the code where that particular problem exists: http://trac.dsource.org/projects/mango/browser/trunk/mango/text/String.d
>
> Line 687 describes the base-class issue (the culprit method is at line 1209), and line 703 illustrates the visibility issue (should be protected but apparently cannot be).
> 


December 18, 2005
Kris schrieb am 2005-12-18:
> class FooTemplate(T) : BarTemplate!(T)
> {
> }
>
> class BarTemplate(T) : Wumpus
> {
>         this (){ff=false;}
> }
>
> class Wumpus
> {
>         private bool ff;
> }
>
> void main()
> {
>         auto f = new FooTemplate!(char);
> }
>
>
> #  class str.BarTemplate!(char).BarTemplate member ff is not accessible
>
>
> It's all in the same module, so 'ff' should be visible. Also have cases where 'protected' exhibits similar behavior ~ had to use "package" there to get visibility within a subclass, although everthing is in one module.

Added to DStress as http://dstress.kuehne.cn/run/p/private_09_A.d http://dstress.kuehne.cn/run/p/private_09_B.d http://dstress.kuehne.cn/run/p/private_09_C.d http://dstress.kuehne.cn/run/p/private_09_D.d

Thomas