Skip to content

Commit

Permalink
Refs #20619. Fix inheritance with aliases
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Mar 12, 2024
1 parent 37fc90c commit 5400105
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ public AliasTypeCode(
super(scope, name);
}

public boolean isHasKey()
{
boolean returnedValue = false;

if (getContentTypeCode() instanceof StructTypeCode)
{
returnedValue = ((StructTypeCode)getContentTypeCode()).isHasKey();
}

return returnedValue;
}

@Override
public long maxSerializedSize(
long current_alignment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public boolean isHasKey()
{
boolean returnedValue = false;

if (getInheritance() != null)
if (getEnclosedInheritance() != null)
{
returnedValue |= ((StructTypeCode)getInheritance()).isHasKey();
returnedValue |= ((StructTypeCode)getEnclosedInheritance()).isHasKey();
}

for (int count = 0; count < getMembers().size() && !returnedValue; ++count)
Expand Down Expand Up @@ -143,9 +143,9 @@ public long maxPlainTypeSerializedSize(

long initial_alignment = current_alignment;

if (getInheritance() != null)
if (getEnclosedInheritance() != null)
{
current_alignment += ((StructTypeCode)getInheritance()).maxPlainTypeSerializedSize(current_alignment, align64);
current_alignment += ((StructTypeCode)getEnclosedInheritance()).maxPlainTypeSerializedSize(current_alignment, align64);
}

for (Member member : getMembers())
Expand Down

0 comments on commit 5400105

Please sign in to comment.