Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Copy nested types value too
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Feb 10, 2015
1 parent a62b737 commit 00f3c43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/rules/mson-inheritance.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion test/fixtures/dataStructures.ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,12 @@
"typeDefinition": {
"typeSpecification": {
"name": "array",
"nestedTypes": []
"nestedTypes": [
{
"literal": "Coupon",
"variable": false
}
]
},
"attributes": []
},
Expand Down

0 comments on commit 00f3c43

Please sign in to comment.