www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD 141 ~ Templates, and member visibility errors

reply "Kris" <fu bar.com> writes:
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). 
Dec 17 2005
next sibling parent "Kris" <fu bar.com> writes:
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).
 

Dec 17 2005
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 -----BEGIN PGP SIGNATURE----- iD8DBQFDpfw+3w+/yD4P9tIRAq2kAJ9CJlNb1C0ewUNQGkkuAssJmPxuCACgnO4n nCPsebt462X7tOTDzjQMkfA= =hXok -----END PGP SIGNATURE-----
Dec 18 2005