mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
b33ab79ed5
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: RyanCavanaugh <[email protected]> Co-authored-by: Ryan Cavanaugh <[email protected]>
20 lines
544 B
TypeScript
20 lines
544 B
TypeScript
// @strict: true
|
|
// @noemit: true
|
|
|
|
// This test verifies that the checker doesn't panic when an assertion predicate
|
|
// references a parameter name that doesn't match any actual function parameter.
|
|
// This specifically tests the code path in isReachableFlowNodeWorker.
|
|
|
|
function assertCondition(
|
|
_condition: boolean
|
|
): asserts condition { // "condition" doesn't match parameter "_condition"
|
|
if (!_condition) {
|
|
throw new Error('Condition failed');
|
|
}
|
|
}
|
|
|
|
function test(): void {
|
|
assertCondition(false);
|
|
console.log("unreachable");
|
|
}
|