www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18725] New: compiler does not check all levels of methods for


          Issue ID: 18725
           Summary: compiler does not check all levels of methods for
                    privateness, if used in invariant
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: sascha.orlov gmail.com

Given this

void main()
        auto s = S(); 

struct S

        size_t[] member; 

        private bool fun() const
                return fun1(); 

        /*private*/ bool fun1() const
                return true; 

The code compiles with or without privateness of fun1. However, if the
privateness for fun1 is missing the run yields a segmentation fault, while when
it is present, the result is as expected. 

If privateness for fun is missing, the compiler complains about using it in the
invariant, as expected.

Apr 04 2018