<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<a class="moz-txt-link-freetext" href="https://www.freepascal.org/docs-html/ref/refse35.html">https://www.freepascal.org/docs-html/ref/refse35.html</a><br>
<blockquote type="cite">
<dl class="description">
<dt class="description">
<span class="cmbx-10">Strict Protected</span><span
class="cmbx-10"> </span> </dt>
<dd class="description"><a id="dx70-94009"></a><a
id="dx70-94010"></a>Is the same as <span class="cmtt-10">Protected</span>,
except that the members of a <span class="cmtt-10">Protected</span>
section are also accessible to other classes implemented in
the same unit. <span class="cmtt-10">Strict</span> <span
class="cmtt-10">protected </span>members are only visible
to descendent classes, not to other classes in the same unit.
</dd>
</dl>
</blockquote>
<br>
<br>
In the below<br>
<br>
TSubFoo can see the strict proctected TTest.<br>
So therefore TSubFoo does not count as "not to other classes in the
same unit."<br>
Well, it is another class, but it is within the class TFoo.<br>
<br>
TSubBar is also another class, but it is within TBar. And for TBar
we have "only visible to descendent classes" => TBar should see
TTest.<br>
And since TSubBar is in TBar?<br>
<br>
So the below code have that error, or is it a bug?<br>
An if it should, what is the correct exact description of "Strict
protected"?<br>
<br>
<br>
program Project1;<br>
type<br>
TFoo = class<br>
strict protected type<br>
TTest = record end;<br>
private type<br>
TSubFoo = class<br>
a: TTest;<br>
end;<br>
end;<br>
<br>
TBar = class(TFoo)<br>
private type<br>
TSubBar = class<br>
a: TTest; // project1.lpr(15,10) Error: Identifier not found
"TTest"<br>
end;<br>
end;<br>
<br>
begin<br>
end.<br>
<br>
</body>
</html>