View Issue Details

IDProjectCategoryView StatusLast Update
000719610000-003: Address SpaceSpecpublic2021-09-07 15:46
ReporterRandy Armstrong Assigned ToJim Luth  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0007196: StructureField should prohibit fields that have the same DataType as the containing Structure.
Description

This is currently allowed but code generators cannot create classes/structures from a DataTypeDefinition that did this.

TagsNo tags attached.
Commit Version
Fix Due Date

Activities

Zbynek Zahradnik

2021-08-11 10:36

developer   ~0014721

I think this is perfectly legal (at least is some cases - see below) and should not be prohibited, because it can also be very useful (such as representing general tree structures). In my client library I fully support it. It currently does not generate code (i.e. programming language code) for the datatypes, but it could.

The "legality" of it depends on details. Certainly you cannot have a mandatory field of the same DataType. But you can have optional field. Or, you can have a field that is an array of such DataTypes. It becomes actually recursive when there are any elements in the array, but the recursion can be "stopped" when the array has no elements. I coined a term "terminable" for data types that are legal in this way, and make sure any infinite processing does not occur (which would happen with types that are not "terminable").

Jim Luth

2021-09-07 15:46

administrator   ~0014821

Submitter agreed to close issue and leave it open in the spec.

Issue History

Date Modified Username Field Change
2021-08-11 08:52 Randy Armstrong New Issue
2021-08-11 10:36 Zbynek Zahradnik Note Added: 0014721
2021-09-07 15:46 Jim Luth Assigned To => Jim Luth
2021-09-07 15:46 Jim Luth Status new => closed
2021-09-07 15:46 Jim Luth Resolution open => no change required
2021-09-07 15:46 Jim Luth Note Added: 0014821