-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Description
π Search Terms
used before being assigned cast type assertion left side LHS parens parentheses
π Version & Regression Information
- This is the behavior changed in 5.7
β― Playground Link
π» Code
declare function describe(name: string, fn: () => void): void
declare function beforeEach(fn: () => void): void;
declare class Something {
foo(): number;
}
describe("", () => {
let blah: Something;
beforeEach(() => {
(blah as any) = class Wow {};
})
})
describe("", () => {
let blah: Something;
beforeEach(() => {
(blah) = class Wow {};
})
})
π Actual behavior
Both assignments error with is used before being assigned
.
π Expected behavior
Neither should, as they are writes.
Additional information about the issue
No response
Copilot
Metadata
Metadata
Assignees
Labels
No labels