Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[experiment] Check for extended empty tuples in isTupleLikeType #52551

Closed

Conversation

jakebailey
Copy link
Member

I want to export this in #52467 but it doesn't work when you write:

type EmptyTuple = []

interface MyEmptyTuple extends EmptyTuple {
	extraInfo: any;
}

Because isTupleLikeType determines tuple-ness by checking for a property named 0 which won't exist on an empty tuple.

I don't think this is the final code but I want to see what this breaks. It seems like there's a lot of code which depends on empty tuples not being handled, and I don't know how much that matters.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 1, 2023
@jakebailey
Copy link
Member Author

@typescript-bot test this
@typescript-bot test top100
@typescript-bot user test this
@typescript-bot run dt
@typescript-bot perf test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 1, 2023

Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 03c06c6. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 1, 2023

Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 03c06c6. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 1, 2023

Heya @jakebailey, I've started to run the perf test suite on this PR at 03c06c6. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 1, 2023

Heya @jakebailey, I've started to run the extended test suite on this PR at 03c06c6. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Feb 1, 2023

Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 03c06c6. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user test suite comparing main and refs/pull/52551/merge:

Something interesting changed - please have a look.

Details

uglify-js

/mnt/ts_downloads/uglify-js/tsconfig.json

  • [NEW] error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'.
    • /mnt/ts_downloads/uglify-js/node_modules/uglify-js/lib/scope.js(647,55)
  • [NEW] error TS2339: Property 'references' does not exist on type 'never'.
    • /mnt/ts_downloads/uglify-js/node_modules/uglify-js/lib/scope.js(662,41)
    • /mnt/ts_downloads/uglify-js/node_modules/uglify-js/lib/scope.js(662,74)
  • [NEW] error TS2322: Type 'never[]' is not assignable to type '[]'.
    • /mnt/ts_downloads/uglify-js/node_modules/uglify-js/lib/scope.js(664,17)

webpack

tsconfig.json

tsconfig.types.json

@typescript-bot
Copy link
Collaborator

Heya @jakebailey, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@jakebailey
Copy link
Member Author

The above definitely implies this PR is wrong as-is, of course.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top-repos suite comparing main and refs/pull/52551/merge:

Something interesting changed - please have a look.

Details

vercel/swr

4 of 11 projects failed to build with the old tsc and were ignored

test/type/tsconfig.json

vuejs/vue

7 of 8 projects failed to build with the old tsc and were ignored

tsconfig.json

@jakebailey
Copy link
Member Author

#52617 does this but correctly.

@jakebailey jakebailey closed this Feb 5, 2023
@jakebailey jakebailey deleted the is-tuple-like-type-empty-tuple branch February 5, 2023 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants