P2010

Code

P2010

Message

Library has a recursive cycle in resolving type names

This error occurs when there is a recursive cycle in resolving type names, where types reference each other in a circular manner.

Example

The following code will generate error P2010:

TYPE
    TypeA : TypeB;
    TypeB : TypeA;  (* Error: Circular type reference *)
END_TYPE

The types TypeA and TypeB reference each other, creating a circular dependency that cannot be resolved.

To fix this error, break the cycle by using a base type:

TYPE
    BaseType : INT;
    TypeA : BaseType;
    TypeB : BaseType;  (* Correct: Both reference base type *)
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.