diff --git a/src/rules/mson-inheritance.coffee b/src/rules/mson-inheritance.coffee index 799c326..3d8bd36 100644 --- a/src/rules/mson-inheritance.coffee +++ b/src/rules/mson-inheritance.coffee @@ -64,8 +64,10 @@ module.exports = push = true # Copy super-type and all the member types to sub type - dataStructure.typeDefinition.typeSpecification.name = superTypeBaseName rule.copyMembers @dataStructures[superType.literal], memberTypeSection + dataStructure.typeDefinition.typeSpecification = + name: superTypeBaseName + nestedTypes: @dataStructures[superType.literal].typeDefinition.typeSpecification.nestedTypes # Push the created type section dataStructure.sections.push memberTypeSection if push and memberTypeSection.content.length diff --git a/test/fixtures/dataStructures.ast.json b/test/fixtures/dataStructures.ast.json index e305597..cebe61f 100644 --- a/test/fixtures/dataStructures.ast.json +++ b/test/fixtures/dataStructures.ast.json @@ -751,7 +751,12 @@ "typeDefinition": { "typeSpecification": { "name": "array", - "nestedTypes": [] + "nestedTypes": [ + { + "literal": "Coupon", + "variable": false + } + ] }, "attributes": [] },