malstraem/arinc424.net

Circular logic in Record424(TSub)?

Closed this issue · 1 comments

Is there circular logic in the class? The declaration public abstract class Record424 : Record424 where TSub : Record424 implies that Record424 inherits from a non-generic Record424 class, and at the same time, TSub must inherit from Record424, which includes the non-generic version. This creates a circular dependency where a generic class depends on a non-generic class, and vice versa.

Is there circular logic in the class?

No, this contraint only does not allow the use of types not inherited from Record424 when declaring any sequenced record type. The main idea here is that any string in ARINC424 have several common fields.

In fact, now this contraint does not affect anything, just a safety net, but in the future it is quite possible that these basic fields may become interesting when creating sequential records.