TypeScript/tests/cases/conformance/expressions/typeGuards
Nathan Shively-Sanders b36c8a0690
Make anyArray.filter(Boolean) return any[], not unknown[] (#31515)
* Add this-parameter workaround to Array.filter

Allows anys.filter(Boolean) to once again return any[], not unknown[].

* Add any constraint to Boolean factory function

I want to test how well this works.

* Remove Boolean factory type guard

* Remove typeGuardBoolean test
2019-05-22 09:45:41 -07:00
..
nullOrUndefinedTypeGuardIsOrderIndependent.ts [Transforms] Merge master 06/06/2016 (#8991) 2016-06-14 11:36:57 -07:00
typeGuardEnums.ts feedback from pr, new tests 2015-10-29 17:51:36 -07:00
typeGuardFunction.ts Addresses CR feedback 2015-06-07 22:16:09 +08:00
typeGuardFunctionErrors.ts Added tests 2017-07-20 02:59:33 +03:00
typeGuardFunctionGenerics.ts Adds tests 2015-06-03 16:58:56 +08:00
typeGuardFunctionOfFormThis.ts Fixing tests 2016-04-09 18:31:19 -07:00
typeGuardFunctionOfFormThisErrors.ts feedback from pr 2015-12-03 13:46:37 -08:00
typeGuardInClass.ts update test with pr feedback 2015-11-17 14:34:02 -08:00
typeGuardIntersectionTypes.ts [Transforms] Merge master 06/06/2016 (#8991) 2016-06-14 11:36:57 -07:00
typeGuardNarrowsPrimitiveIntersection.ts [Transforms] Merge master 06/06/2016 (#8991) 2016-06-14 11:36:57 -07:00
typeGuardNarrowsToLiteralType.ts [Transforms] Merge master 06/06/2016 (#8991) 2016-06-14 11:36:57 -07:00
typeGuardNarrowsToLiteralTypeUnion.ts [Transforms] Merge master 06/06/2016 (#8991) 2016-06-14 11:36:57 -07:00
typeGuardNesting.ts feedback from pr, new tests 2015-10-29 17:51:36 -07:00
typeGuardOfFormExpr1AndExpr2.ts TypeGuard of for expr1 && expr2 2014-11-06 13:04:37 -08:00
typeGuardOfFormExpr1OrExpr2.ts Typeguards of form expr1 || expr2 2014-11-06 13:04:40 -08:00
typeGuardOfFormFunctionEquality.ts Add test 2016-02-12 15:08:07 -08:00
typeGuardOfFormInstanceOf.ts Adds tests 2015-10-06 19:03:11 +08:00
typeGuardOfFormInstanceOfOnInterface.ts Add test case for instance of type guard with interface with prototype property 2014-11-12 12:36:06 -08:00
typeGuardOfFormIsType.ts Adds tests 2015-06-03 16:58:56 +08:00
typeGuardOfFormIsTypeOnInterfaces.ts Adds tests 2015-06-03 16:58:56 +08:00
typeGuardOfFormNotExpr.ts Typeguards of form !expr 2014-11-06 13:04:43 -08:00
typeGuardOfFormThisMember.ts grand unified theory of predicate types 2015-12-08 17:08:57 -08:00
typeGuardOfFormThisMemberErrors.ts grand unified theory of predicate types 2015-12-08 17:08:57 -08:00
typeGuardOfFormTypeOfBoolean.ts Fix some tests 2016-03-29 19:59:05 -07:00
typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts Add test cases for typeof x == s and typeof x != s form of typeguard which has no effect on narrowing type 2014-11-12 12:49:29 -08:00
typeGuardOfFormTypeOfFunction.ts Add tests 2018-06-02 17:43:37 -07:00
typeGuardOfFormTypeOfIsOrderIndependent.ts [Transforms] Merge master 06/06/2016 (#8991) 2016-06-14 11:36:57 -07:00
typeGuardOfFormTypeOfNotEqualHasNoEffect.ts Add test cases for typeof x == s and typeof x != s form of typeguard which has no effect on narrowing type 2014-11-12 12:49:29 -08:00
typeGuardOfFormTypeOfNumber.ts Fix some tests 2016-03-29 19:59:05 -07:00
typeGuardOfFormTypeOfOther.ts Add typeof test case and update baselines 2017-01-31 10:28:32 -08:00
typeGuardOfFormTypeOfPrimitiveSubtype.ts Fix #6277 - stop looking for any specifically, and use isTypeSubtypeOf like the old code 2016-01-03 07:43:30 -05:00
typeGuardOfFormTypeOfString.ts Fix some tests 2016-03-29 19:59:05 -07:00
typeGuardOfFromPropNameInUnionType.ts Test:in doesn't narrow types with string indexers 2017-12-07 10:56:33 -08:00
typeGuardRedundancy.ts naive change and new tests 2015-10-28 13:48:32 -07:00
typeGuardsDefeat.ts Modifying tests and accepting new baselines 2014-11-14 10:42:31 -08:00
typeGuardsInClassAccessors.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInClassMethods.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInConditionalExpression.ts Fixing some tests 2016-03-26 08:20:06 -07:00
typeGuardsInDoStatement.ts Add control flow tests 2016-03-25 21:29:58 +01:00
typeGuardsInExternalModule.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInForStatement.ts Add control flow tests 2016-03-25 21:29:58 +01:00
typeGuardsInFunction.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInFunctionAndModuleBlock.ts Fix test 2016-05-26 16:26:30 -07:00
typeGuardsInGlobal.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInIfStatement.ts Fixing some tests 2016-03-26 08:20:06 -07:00
typeGuardsInModule.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInProperties.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsInRightOperandOfAndAndOperator.ts Fixing some tests 2016-03-26 08:20:06 -07:00
typeGuardsInRightOperandOfOrOrOperator.ts Fixing some tests 2016-03-26 08:20:06 -07:00
typeGuardsInWhileStatement.ts Add control flow tests 2016-03-25 21:29:58 +01:00
typeGuardsObjectMethods.ts Tests for typeguards allowed on variables and parameters only 2014-11-06 13:04:27 -08:00
typeGuardsOnClassProperty.ts Address code review 2015-04-16 20:09:03 -07:00
typeGuardsWithAny.ts Type guard narrows type any in a primitive type check 2015-01-08 14:27:39 -08:00
typeGuardsWithInstanceOf.ts Fix narrow type for instanceOf and add testcases 2015-01-14 11:30:58 -08:00
typeGuardsWithInstanceOfByConstructorSignature.ts [Transforms] Merge master 08/09 (#10263) 2016-08-26 15:51:10 -07:00
typeGuardTautologicalConsistiency.ts feedback from pr, new tests 2015-10-29 17:51:36 -07:00
typeGuardTypeOfUndefined.ts exhaustive tests 2015-11-13 13:33:54 -08:00
TypeGuardWithArrayUnion.ts Improved handing of union types in type guards 2015-01-12 14:51:20 -08:00
TypeGuardWithEnumUnion.ts Adding tests 2015-01-24 17:23:22 -08:00
typePredicateASI.ts Don't consume 'is' keyword if there is a preceding line terminator 2015-06-09 11:12:00 -07:00
typePredicateOnVariableDeclaration01.ts Added tests. 2016-02-12 15:22:06 -08:00
typePredicateOnVariableDeclaration02.ts Added tests. 2016-02-12 15:22:06 -08:00