-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Fix support for intersections in template literal placeholder types #56434
Conversation
@typescript-bot test top100 |
Heya @ahejlsberg, I've started to run the tsc-only perf test suite on this PR at ca7e9c4. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at ca7e9c4. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the diff-based top-repos suite on this PR at ca7e9c4. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at ca7e9c4. You can monitor the build here. Update: The results are in! |
@ahejlsberg Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@ahejlsberg Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
Hey @ahejlsberg, the results of running the DT tests are ready. |
@ahejlsberg Here are the results of running the top-repos suite comparing Everything looks good! |
@typescript-bot pack this |
Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at b464619. You can monitor the build here. |
Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@jakebailey @DanielRosenwasser So, there's this beauty: type Goo<T> = {
[key: `abc${"def" & { tag: T }}`]: string;
}
type T0 = Goo<void>; // Index signature key type not instantiated so type parameter leaks By design we don't instantiate index signature key types (that's what mapped types are for), but that in turn means we really can't permit anything generic in tag types. But we have no guaranteed way of detecting whether an object type contains something generic. I should say that there's nothing particularly dangerous about the leaked type parameter (it's just a type that isn't compatible with anything but itself), but it's certainly esthetically displeasing. Starting to seem like we just want to strip tags in template literal placeholders. |
Hmm, the leaking type parameter issue isn't actually anything new: type Leak<T> = {
[key: string & { tag: T }]: string;
}
type T0 = Leak<void>; // Index signature key type not instantiated so type parameter leaks I seem to recall us discussing this at some point in the past but can't find anything. As I said above, it's harmless, but certainly doesn't look right. |
@typescript-bot cherry-pick this to release-5.3 |
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
Hey @DanielRosenwasser, I've opened #56491 for you. |
…e-5.3 (#56491) Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
Implements the changes discussed here and fixes #54177 according to our design meeting discussion.
Fixes #54177.