Repository navigation
Conversation
`bun check` and `tsc` 7.0.2 report five type errors in four files of test/. #44361, #44615 and #38003 added those lines after the last push to #44614 and before its merge, so the tree it left clean is not clean on main. The transpiler erases each edit. Each of the four files transpiles to the same bytes as before.
Collaborator
Author
|
Status: ready for review. Reproduction
PR: #44861 |
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behaviour change: none
Problem
cd test && bun checkreportsFound 5 errors in 4 files, checked 2,639 files.tsc7.0.2 reports the same five. Fix every type error intest/#44614 says this tree has none.bun check- a TypeScript type checker builtin to Bun #44361, Upgrade WebKit to dbdca7545d #44615 and ByteStream: report a stored producer error and keep the taken prefix with the buffer #38003 added the five lines. They merged after the last push to Fix every type error intest/#44614 and before its merge.Fix
as const, a parameter type, and!onserver.hostnameandserver.port.bun build --no-bundlegives the same bytes for each file as on main.as anyonBun.write(s3file, response): bun-types has no overload for it. Fix every type error intest/#44614 lists that gap and casts the same call infetch-backpressure.test.ts.bun bd checkandtsc7.0.2 intest/report no errors in 2,639 files. On a release build of e655c58, the edited tests pass, and so doess3-stream-error-gc.test.ts, which runs the fixture. Notes has every run.Background
Server#hostnameandServer#portareundefinedfor a server on a unix socket. OtherBun.connectcalls inbun-server.test.tsuse!for that.Intl.DurationFormat#format.Intl.DurationInputdoes not exist.Bun.writeoverload here. It changes declarations that users see, so it needs its own PR with a fixture case (bun-types: declare bytes() on ShellPromise #44725).Downsides
test/:.github/workflows/lint.ymlchecksscripts,src/js,srcandsrc/runtime/bake.Bun.write(s3file, response)stays a type error for users until bun-types has the overload.Notes
The five errors on main (
bun checkandtsc7.0.2 print the same text)Each edit
check.test.ts:298[...] as Record<string, string>[]. The object literals in the array have different keys, so each member of the element type gets the keys of the others as?: undefined.proxy-stress-matrix.test.ts:313has the same cast from #44614.check.test.ts:464as conston the list of file names at line 458. For astringname,name && readFileSync(...)can be"". For the literal names it cannot. A cast at line 464 moves the object literal to three lines, and then the transpiled file differs in line breaks.bun-server.test.ts:2180server.hostname!andserver.port!, as in lines 90 and 2122 of that file.webkit-upgrade-dbdca7545d.test.ts:84Parameters<Intl.DurationFormat["format"]>[0].lib.es2025.intl.d.tsdeclaresformat(duration: Partial<Record<DurationFormatUnit, number>>).s3-stream-stored-error-fixture.ts:79client.file("copy") as any, as infetch-backpressure.test.ts:1723.S3File#writeandS3Client#writetake aResponse. OnlyBun.writehas no overload for it.Type checks, in
test/bun bd check(debug build)Found 5 errors in 4 files, checked 2,639 filesNo type errors in 2,639 filesbun check, canary1.4.3-canary.1+e655c5803No type errors in 2,639 filestsc7.0.2 (typescript7oftest/package.json)tsc6.0.2 (bun run typecheck)jsx-dev.tsxandjsx-production.tsxthat #44614 describesSame JavaScript
bun build --no-bundle --target=bun <file>, with the file in its place so thattest/tsconfig.jsonapplies, on main and on this branch. The output is identical for all four files: 968,848 bytes forcheck.test.ts, 120,847 forbun-server.test.ts, 4,960 forwebkit-upgrade-dbdca7545d.test.ts, 5,396 fors3-stream-stored-error-fixture.ts.Test runs
Release build of e655c58 (the canary), on this branch:
bun-server.test.ts: 81 pass, 1 skip.webkit-upgrade-dbdca7545d.test.ts: 9 pass, 1 todo.s3-stream-error-gc.test.ts, which runs the fixture: 4 pass.check.test.ts -t "what stops the type check says how many files it leaves"and-t "are those of TypeScript 7, byte for byte": both pass.check.test.ts, four runs on main and four on this branch, in turns: 8, 24, 7 and 10 tests fail on main, 8, 15, 5 and 14 on this branch. Each failure is the 5000 ms timeout, none is a failed assertion. My machine has 12 cores with a cap.Debug build (
bun bd test), on this branch:webkit-upgrade-dbdca7545d.test.ts: 9 pass, 1 todo.s3-stream-error-gc.test.ts: 4 pass.bun-server.test.ts: the edited test passes. 5 other tests reach the 5000 ms timeout. On main 13 do. They start a debug build of bun in a child process.check.test.ts -t "are those of TypeScript 7, byte for byte"passes.check.test.ts -t "what stops the type check says how many files it leaves"reaches the 5000 ms timeout in 3 of 3 runs, and in 2 of 2 runs on main. It starts bun nine times. With--timeout 120000it passes in 13.1 s.no test proof · iteration 0 · platform-specific test(s) that do not run on this machine, deferring to CI, which covers all platforms: test/js/bun/http/bun-server.test.ts, test/cli/check/check.test.ts