From 00f3c430091fb371db1f856279e77e56c1949975 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Wed, 11 Feb 2015 02:09:31 +0530 Subject: [PATCH] Copy nested types value too --- src/rules/mson-inheritance.coffee | 4 +++- test/fixtures/dataStructures.ast.json | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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": [] },