mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
830 B
Plaintext
23 lines
830 B
Plaintext
assertsPredicateParameterMismatch.ts(7,12): error TS1225: Cannot find parameter 'condition'.
|
|
|
|
|
|
==== assertsPredicateParameterMismatch.ts (1 errors) ====
|
|
// 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"
|
|
~~~~~~~~~
|
|
!!! error TS1225: Cannot find parameter 'condition'.
|
|
if (!_condition) {
|
|
throw new Error('Condition failed');
|
|
}
|
|
}
|
|
|
|
function test(): void {
|
|
assertCondition(false);
|
|
console.log("unreachable");
|
|
}
|
|
|