-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Control FlowThe issue relates to control flow analysisThe issue relates to control flow analysisEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 3.7.x-dev.20200221
Search Terms:
Code
const m = ''.match('');
m?.[0] && m[0];
m?.[0]! && m[0];
m?.[0].length! > 0 && m[0];
m?.[0].split('').slice() && m[0];
m?.[0].split('')!.slice() && m[0];
Expected behavior:
const m = ''.match('');
m?.[0] && m[0]; // ok
m?.[0]! && m[0]; // ok
m?.[0].length! > 0 && m[0]; // ok
m?.[0].split('').slice() && m[0]; // ok
m?.[0].split('')!.slice() && m[0]; // ok
Actual behavior:
const m = ''.match('');
m?.[0] && m[0]; // ok
m?.[0]! && m[0]; // error
m?.[0].length! > 0 && m[0]; // error
m?.[0].split('').slice() && m[0]; // ok
m?.[0].split('')!.slice() && m[0]; // error
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Control FlowThe issue relates to control flow analysisThe issue relates to control flow analysisEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this