Skip to content

Commit

Permalink
Add regression test for #29168
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Jan 20, 2019
1 parent dbea08f commit cf479fc
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/cases/compiler/contextualTypeShouldBeLiteral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,30 @@ let xyz: LikeA | LikeB = {
}
};

xyz;
xyz;

// Repro from #29168

interface TestObject {
type?: 'object';
items: {
[k: string]: TestGeneric;
};
}

interface TestString {
type: 'string';
}

type TestGeneric = (TestString | TestObject) & { [k: string]: any; };

const test: TestGeneric = {
items: {
hello: { type: 'string' },
world: {
items: {
nested: { type: 'string' }
}
}
}
};

0 comments on commit cf479fc

Please sign in to comment.