class A var _a as A? cue init base.init def pub1 pass def pub2(i as int) pass def prot1 is protected pass def prot2(i as int) is protected pass def priv1 is private pass def priv2(i as int) is private pass def invokeA if _a _a.pub1 _a.pub2(5) _a.prot1 _a.prot2(5) _a.priv1 _a.priv2(5) A().pub1 A().pub2(5) A().prot1 A().prot2(5) A().priv1 A().priv2(5) B().pub1 B().pub2(5) B().prot1 B().prot2(5) B().priv1 B().priv2(5) C().pub1 C().pub2(5) C().prot1 C().prot2(5) C().priv1 C().priv2(5) class B inherits A cue init base.init def invokeB if _a _a.pub1 _a.pub2(5) _a.prot1 # .error. Cannot access protected "prot1" in "_a" whose type is "A". The qualifier must be of type "B" or derived from it. _a.prot2(5) # .error. Cannot access protected "prot2" in "_a" whose type is "A". The qualifier must be of type "B" or derived from it. _a.priv1 # .error. Cannot access private "priv1" in "_a" whose type is "A". _a.priv2(5) # .error. Cannot access private "priv2" in "_a" whose type is "A". A().pub1 A().pub2(5) A().prot1 # .error. Cannot access protected "prot1" in "A()" whose type is "A". The qualifier must be of type "B" or derived from it. A().prot2(5) # .error. Cannot access protected "prot2" in "A()" whose type is "A". The qualifier must be of type "B" or derived from it. A().priv1 # .error. Cannot access private A().priv2(5) # .error. Cannot access private B().pub1 B().pub2(5) B().prot1 B().prot2(5) B().priv1 # .error. Cannot access private B().priv2(5) # .error. Cannot access private C().pub1 C().pub2(5) C().prot1 C().prot2(5) C().priv1 # .error. Cannot access private C().priv2(5) # .error. Cannot access private class C inherits B cue init base.init def invokeC if _a _a.pub1 _a.pub2(5) _a.prot1 # .error. Cannot access protected "prot1" in "_a" whose type is "A". The qualifier must be of type "C" or derived from it. _a.prot2(5) # .error. Cannot access protected "prot2" in "_a" whose type is "A". The qualifier must be of type "C" or derived from it. _a.priv1 # .error. Cannot access private _a.priv2(5) # .error. Cannot access private A().pub1 A().pub2(5) A().prot1 # .error. Cannot access protected "prot1" in "A()" whose type is "A". The qualifier must be of type "C" or derived from it. A().prot2(5) # .error. Cannot access protected "prot2" in "A()" whose type is "A". The qualifier must be of type "C" or derived from it. A().priv1 # .error. Cannot access private A().priv2(5) # .error. Cannot access private B().pub1 B().pub2(5) B().prot1 # .error. Cannot access protected "prot1" in "B()" whose type is "B". The qualifier must be of type "C" or derived from it. B().prot2(5) # .error. Cannot access protected "prot2" in "B()" whose type is "B". The qualifier must be of type "C" or derived from it. B().priv1 # .error. Cannot access private B().priv2(5) # .error. Cannot access private C().pub1 C().pub2(5) C().prot1 C().prot2(5) C().priv1 # .error. Cannot access private C().priv2(5) # .error. Cannot access private class AG var _a as AG? cue init base.init def pub1 pass def pub2(i as int) pass def prot1 is protected pass def prot2(i as int) is protected pass def priv1 is private pass def priv2(i as int) is private pass def invokeA if _a _a.pub1 _a.pub2(5) _a.prot1 _a.prot2(5) _a.priv1 _a.priv2(5) AG().pub1 AG().pub2(5) AG().prot1 AG().prot2(5) AG().priv1 AG().priv2(5) BG().pub1 BG().pub2(5) BG().prot1 BG().prot2(5) BG().priv1 BG().priv2(5) CG().pub1 CG().pub2(5) CG().prot1 CG().prot2(5) CG().priv1 CG().priv2(5) class BG inherits AG cue init base.init def invokeB if _a _a.pub1 _a.pub2(5) _a.prot1 # .error. Cannot access protected "prot1" in "_a" whose type is "AG". The qualifier must be of type "BG" or derived from it. _a.prot2(5) # .error. Cannot access protected "prot2" in "_a" whose type is "AG". The qualifier must be of type "BG" or derived from it. _a.priv1 # .error. Cannot access private "priv1" in "_a" whose type is "AG". _a.priv2(5) # .error. Cannot access private "priv2" in "_a" whose type is "AG". AG().pub1 AG().pub2(5) AG().prot1 # .error. Cannot access protected "prot1" in "AG()" whose type is "AG". The qualifier must be of type "BG" or derived from it. AG().prot2(5) # .error. Cannot access protected "prot2" in "AG()" whose type is "AG". The qualifier must be of type "BG" or derived from it. AG().priv1 # .error. Cannot access private AG().priv2(5) # .error. Cannot access private BG().pub1 BG().pub2(5) BG().prot1 BG().prot2(5) BG().priv1 # .error. Cannot access private BG().priv2(5) # .error. Cannot access private CG().pub1 CG().pub2(5) CG().prot1 CG().prot2(5) CG().priv1 # .error. Cannot access private CG().priv2(5) # .error. Cannot access private class CG inherits BG cue init base.init def invokeC if _a _a.pub1 _a.pub2(5) _a.prot1 # .error. Cannot access protected "prot1" in "_a" whose type is "AG". The qualifier must be of type "CG" or derived from it. _a.prot2(5) # .error. Cannot access protected "prot2" in "_a" whose type is "AG". The qualifier must be of type "CG" or derived from it. _a.priv1 # .error. Cannot access private _a.priv2(5) # .error. Cannot access private AG().pub1 AG().pub2(5) AG().prot1 # .error. Cannot access protected "prot1" in "AG()" whose type is "AG". The qualifier must be of type "CG" or derived from it. AG().prot2(5) # .error. Cannot access protected "prot2" in "AG()" whose type is "AG". The qualifier must be of type "CG" or derived from it. AG().priv1 # .error. Cannot access private AG().priv2(5) # .error. Cannot access private BG().pub1 BG().pub2(5) BG().prot1 # .error. Cannot access protected "prot1" in "BG()" whose type is "BG". The qualifier must be of type "CG" or derived from it. BG().prot2(5) # .error. Cannot access protected "prot2" in "BG()" whose type is "BG". The qualifier must be of type "CG" or derived from it. BG().priv1 # .error. Cannot access private BG().priv2(5) # .error. Cannot access private CG().pub1 CG().pub2(5) CG().prot1 CG().prot2(5) CG().priv1 # .error. Cannot access private CG().priv2(5) # .error. Cannot access private class Program def main a = A() a.pub1 a.pub2(5) a.invokeA b = B() b.pub1 b.pub2(5) b.invokeA b.invokeB c = C() c.pub1 c.pub2(5) c.invokeA c.invokeB c.invokeC ag = AG() ag.pub1 ag.pub2(5) ag.invokeA bg = BG() bg.pub1 bg.pub2(5) bg.invokeA bg.invokeB cg = CG() cg.pub1 cg.pub2(5) cg.invokeA cg.invokeB cg.invokeC