开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜