Narrowed-to-never string-literal union passed to a `never` parameter: SC1090 "'string' values where 'number' is expected"
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Start by running the provided repro.ts example with scriptc 0.4.4 and compare it with Node’s type stripping; the report identifies string literal union narrowing to never as the failing case. Then trace how the compiler lowers that narrowed value and how it checks the argument passed to unreachable. Done when the example compiles and the reported number union and typeof narrowing cases still behave as described.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Disclosure: this report was produced with the help of an AI agent (Claude Code). The agent reduced the problem from a real codebase to the repro below, ran every command shown, and drafted this text; a human reviewed it and decided to file it. The commands and outputs are real runs.
Environment: scriptc 0.4.4 (@scriptc/cli-linux-x64-gnu), Linux x86_64, Node 22.22.0. Reference behaviour from node --experimental-strip-types.
function unreachable(_: never): never { throw new Error("unreachable"); }
type K = "a" | "b";
function f(k: K): number {
if (k === "a") return 1;
if (k === "b") return 2;
return unreachable(k);
}
console.log(f(Date.now() > 0 ? "a" : "b"));
$ scriptc build repro.ts -o t
repro.ts:6:22 - error SC1090: 'string' values where 'number' is expected is not supported yet
$ node --experimental-strip-types repro.ts
1
Expected: compiles (the standard exhaustiveness-check idiom).
Observations (all run 2026-10-24)
unreachable(k as never)fails the same way.- The same program with a number-literal union (
type K = 1 | 2) compiles and prints1. typeof-narrowing astring | numbertonevercompiles and prints1.- So the failure seems specific to a string-literal union narrowed to
never, which appears to be lowered asnumber.
Context: vjuga FunctionUtils.unreachable(_: never): never, used for exhaustive switch/if chains over string-literal unions.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.4k
- Fork
- 204
- Merge trung bình
- 7 giờ 35 phút
- Pull request đã merge (30 ngày)
- 873
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của vercel-labs/scriptc
-
`process.execPath` uses the ANSI API on Windows, so non-ASCII paths are garbled when the ANSI code page is not UTF-8Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
vercel-labs/scriptc#2910 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Assigning a wide Node object (process.stdout) to a narrow { write } record fails SC2002 (width-copy rules)Có thể đã có người làm @ctate đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
vercel-labs/scriptc#2949 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Analysis OOM (exit 137 at ~4 GB) on large TypeScript graphsCó thể đã có người làm @espetro đã nhận 1 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
vercel-labs/scriptc#2916 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Publish prebuilt @scriptc/libnode-* packs with the native installerCó thể đã có người làm @ctate đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#2915 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
http.Server should lower off, listeners, and newListener for HTTP eventsCó thể đã có người làm @espetro đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
vercel-labs/scriptc#2913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel-labs/scriptc
Issue tương tự
-
unwrapDatabaseError masks real DB errors with TypeError: Cannot convert object to primitive valueĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NEARBuilders/everything-dev#798 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vercel-labs/durable-harness#53 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regionsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
experiência: a doc manda subir para o Micro do Supabase, mas não diz que exige plano pago nem quanto custaCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea/docs area/ui enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
melgarafael/DeskcommCRM#4098 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies platform: ios
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
software-mansion/react-native-executorch#1617 ·
Maintainer thường phản hồi trong vòng 1 ngày