Add tests for #15358 (#17664)

This commit is contained in:
Wesley Wigham 2017-08-08 13:06:12 -07:00 committed by GitHub
parent 83ae8afef8
commit af20adb137
3 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,13 @@
tests/cases/compiler/checkTypePredicateForRedundantProperties.ts(1,35): error TS2300: Duplicate identifier 'a'.
tests/cases/compiler/checkTypePredicateForRedundantProperties.ts(1,46): error TS2300: Duplicate identifier 'a'.
==== tests/cases/compiler/checkTypePredicateForRedundantProperties.ts (2 errors) ====
function addProp2(x: any): x is { a: string; a: string; } {
~
!!! error TS2300: Duplicate identifier 'a'.
~
!!! error TS2300: Duplicate identifier 'a'.
return true;
}

View file

@ -0,0 +1,10 @@
//// [checkTypePredicateForRedundantProperties.ts]
function addProp2(x: any): x is { a: string; a: string; } {
return true;
}
//// [checkTypePredicateForRedundantProperties.js]
function addProp2(x) {
return true;
}

View file

@ -0,0 +1,3 @@
function addProp2(x: any): x is { a: string; a: string; } {
return true;
}