microsoft / microsoft/TypeScript
"used before being assigned" fires on LHS inside parens/type assertion
Đang mở
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 132
Mô tả
🔎 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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.