fix(language-service): bug of accessing a string index signature using dot notation (#34177)

PR Close #34177
This commit is contained in:
ivanwonder
2019-12-02 15:22:07 +08:00
committed by Andrew Kushnir
parent 5f0703de16
commit 72a5a8cab7
3 changed files with 18 additions and 4 deletions

View File

@ -180,6 +180,14 @@ describe('diagnostics', () => {
expect(diags[0].messageText)
.toBe(`Identifier 'badProperty' is not defined. 'Hero' does not contain such a member`);
});
it('should not produce errors with dot notation if stringIndexType is js primitive type',
() => {
mockHost.override(TEST_TEMPLATE, `
{{primitiveType.test}}`);
const diags = ngLS.getDiagnostics(TEST_TEMPLATE);
expect(diags.length).toBe(0);
});
});
});