P2036

Code

P2036

Message

Nested REF_TO (multi-level indirection) is not supported

This error occurs when a REF_TO type declaration references another REF_TO type, creating multi-level indirection. Nested references are not supported.

Example

The following code will generate error P2036:

TYPE
    IntRef : REF_TO INT;
    IntRefRef : REF_TO IntRef;  (* Error: nested REF_TO *)
END_TYPE

To fix this error, use only a single level of indirection:

TYPE
    IntRef : REF_TO INT;  (* Correct: single level of REF_TO *)
END_TYPE

Think IronPLC is wrong about this?

If you believe this diagnostic is incorrect, open an issue on GitHub with a small sample that demonstrates the problem.