<p dir="ltr">This should not compile. Cat cant access create because it is private. Ok it can access it but only if you move cat into same module as animal</p>
<div class="gmail_quote">Dne 6. 4. 2016 17:16 napsal uživatel "Andre via Digitalmars-d-learn" <<a href="mailto:digitalmars-d-learn@puremagic.com">digitalmars-d-learn@puremagic.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
With 2.071 following coding does not compile anymore and somehow I feel it should compile.<br>
The issue is with line "cat.create();".<br>
Cat is a sub type of Animal. Animal "owns" method create and I want to call the method<br>
create within the class Animal for cat.<br>
<br>
Is the error message "no property create for type '<a href="http://b.cat" rel="noreferrer" target="_blank">b.cat</a>'" valid or not?<br>
<br>
Kind regards<br>
André<br>
<br>
module a;<br>
import b;<br>
<br>
class Animal<br>
{<br>
        private void create() {}<br>
        <br>
        void foo(Cat cat)<br>
        {<br>
                cat.create(); // >> no property create for type '<a href="http://b.cat" rel="noreferrer" target="_blank">b.cat</a>'<br>
        }<br>
}<br>
<br>
void main() {}<br>
<br>
--------------<br>
<br>
module b;<br>
import a;<br>
<br>
class Cat: Animal {};<br>
<br>
compile with<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
rdmd a b<br>
</blockquote></blockquote>
</blockquote></div>