What does the "A type used from another type must be public" error mean?
Delphi Prism for .NET:
For some of my member functions, I am getting an error, "A type used from another type must be public."
For instance, take a look at some of my member functions that are raising the error.
method ConnectTest(x,y,pg:integer):TConnection; virtual; <---error - TConnection must be public
method Addtheobject(co:TControlObject); <--- TControlObject must be public
method ClearCache(cc:TCacheType); <--- TCacheType must be public
All these methods are from within a class under public access specifier.
So, why are they raising this error?
Thanks,开发者_JAVA技巧
If you have a public
method that returns a type T
or has a parameter of a type T
, then T
must also be public
. Otherwise, the situation could easily arise where your method could be called, but its arguments couldn't be supplied, or its return value couldn't be stored/inspected/etc.
精彩评论