feat(7481): Operator to ensure an expression is contextually typed by, and satisfies, some type (#46827)

* feat(7481): add explicit type compatibility check with 'satisfies' expression

* Add failing test for lack of intersectioned contextual type

* Implement the behavior

* Add test corresponding to the 'if'

* Add test based on defined scenarios

* remove isExpression in favor of using type casting

* move tests from compiler to conformance folder

* update baseline

* add missing contextFlags argument

* use asserted type

* accept baseline

Co-authored-by: Ryan Cavanaugh <ryanca@microsoft.com>
This commit is contained in:
Oleksandr TandRyan Cavanaugh authored and GitHub committed 2022-08-26 10:05:52 -07:00
1 parent 07157914eb
commit 164dddc48e
102 files changed
+3172 -449

No files matched your search

+2
View File
@@ -143,6 +143,8 @@ namespace Harness {
"exactOptionalPropertyTypes",
"useDefineForClassFields",
"useUnknownInCatchVariables",
"noUncheckedIndexedAccess",
"noPropertyAccessFromIndexSignature",
];
private fileName: string;
private justName: string;