diff --git a/lib/jsdoc/tag/type.js b/lib/jsdoc/tag/type.js index b0ca81f2..1720d804 100644 --- a/lib/jsdoc/tag/type.js +++ b/lib/jsdoc/tag/type.js @@ -196,7 +196,7 @@ function getTypeStrings(parsedType, isOutermostType) { // if this is the outermost type, we strip the modifiers; otherwise, we keep them if (isOutermostType) { applications = parsedType.applications.map(function(application) { - return getTypeStrings(application); + return catharsis.stringify(application); }).join(', '); typeString = util.format( '%s.<%s>', getTypeStrings(parsedType.expression), applications ); diff --git a/test/specs/jsdoc/tag/type.js b/test/specs/jsdoc/tag/type.js index 7b8c41c2..4add5b00 100644 --- a/test/specs/jsdoc/tag/type.js +++ b/test/specs/jsdoc/tag/type.js @@ -243,6 +243,13 @@ describe('jsdoc/tag/type', function() { expect(info.type).toEqual( ['string'] ); expect(info.variable).toBe(true); }); + + it('should set the type correctly for type applications that contain type unions', + function() { + var desc = '{Array.<(string|number)>} foo - Foo.'; + var info = jsdoc.tag.type.parse(desc, true, true); + expect(info.type).toEqual(['Array.<(string|number)>']); + }); }); }); });