Allow one leading ignored “|” or “&” in a type position

This commit is contained in:
Marius Schulz
2016-11-19 22:30:18 +01:00
parent f2a7434fa3
commit 443abe5373

View File

@@ -2615,6 +2615,7 @@ namespace ts {
}
function parseUnionOrIntersectionType(kind: SyntaxKind, parseConstituentType: () => TypeNode, operator: SyntaxKind): TypeNode {
parseOptional(operator);
let type = parseConstituentType();
if (token() === operator) {
const types = createNodeArray<TypeNode>([type], type.pos);