Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AddNoInfer intrinsic type#52968

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Andarist wants to merge7 commits intomicrosoft:mainfromAndarist:noinfer
Closed

Conversation

@Andarist
Copy link
Contributor

closes#14829

There is still some work to be done here (type displays on hover, assignability bug, and maybe more) - but I'm pushing this out to receive an early feedback

cc@RyanCavanaugh

whzx5byb, SferaDev, joealden, KhraksMamtsov, jgoux, jasonkuhrt, astahmer, and unional reacted with thumbs up emojihasparus, david-shortman, gamov, jgoux, jasonkuhrt, ChrisKulesza, Vanilagy, and craigphicks reacted with heart emojiwhzx5byb, josh-degraw, jgoux, devgioele, and SferaDev reacted with rocket emojiwhzx5byb, tonivj5, hasparus, jgoux, ssalbdivad, and ShawnMorreau reacted with eyes emoji
@typescript-bot
Copy link
Collaborator

The TypeScript team hasn't accepted the linked issue#14829. If you can get it accepted, this PR will have a better chance of being reviewed.

@typescript-bottypescript-bot added the For Uncommitted BugPR for untriaged, rejected, closed or missing bug labelFeb 25, 2023
@sandersn
Copy link
Member

@Andarist did you learn anything interesting from the implementation? If so, can you add a report to the end of#14829? Unless@DanielRosenwasser@RyanCavanaugh or@ahejlsberg are interested in taking up this feature in a design meeting, it's likely that this PR will sit until it gets stale.

tonivj5 reacted with eyes emoji

@sandersnsandersn self-assigned thisMar 7, 2023
@Andarist
Copy link
ContributorAuthor

@jakebailey would you mind creating a playground for this? :)

@jakebailey
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commentedMar 13, 2023
edited
Loading

Heya@jakebailey, I've started to run the tarball bundle task on this PR at86448ff. You can monitor the buildhere.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedMar 13, 2023
edited
Loading

Hey@jakebailey, I've packed this intoan installable tgz. You can install it for testing by referencing it in yourpackage.json like so:

{    "devDependencies": {        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/149238/artifacts?artifactName=tgz&fileId=E040D91AAAB70FE622A8C39FD6DF27B76C392A7C8C3B48C212D760AAF66AFD4702&fileName=/typescript-5.1.0-insiders.20230313.tgz"    }}

and then runningnpm install.


There is also a playgroundfor this build and annpm module you can use via"typescript": "npm:@typescript-deploys/pr-build@5.1.0-pr-52968-5".;

@unional
Copy link
Contributor

Hi, I am reading#14829 and trying to addNoInfer<T> to fix thestub() function intype-plus.

An I notice the typetype NoInfer<T> = T & { [K in keyof T]: T[K] } there works with theAnimal|Dog example but does not work with:

typeNoInfer<T>=T&{[KinkeyofT]:T[K]}typeRecursivePartial<T>={[PinkeyofT]?:T[P]extends(inferU)[]?RecursivePartial<U>[]:T[P]extendsRecord<any,any>?RecursivePartial<T[P]>:T[P]}functionfoo(v:{a:number,b:string}){}functionstub<T>(v:RecursivePartial<NoInfer<T>>):T{returnvasT}foo(stub({a:1})// error// Argument of type '{ a: number; }' is not assignable to parameter of type '{ a: number; b: string; }'.// Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: string; }'.

It works with the following type:type NoInfer<T> = Or<IsNull<T>, IsUndefined<T>, T, T & {}>
(whereOr<A,B,Then,Else>,IsNull<T>,IsUndefined<T> does what their name suggest).

Just want to bring it up so that this test case is covered in your implementation.
🌷

@Andarist
Copy link
ContributorAuthor

@RyanCavanaugh Since 5.2 development has started recently - perhaps we could get some current thoughts from the team about this feature? 😉

jakeboone02 reacted with thumbs up emoji

@andrewbranch
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document themon our wiki's API Breaking Changes page.

Also, please make sure@DanielRosenwasser and@RyanCavanaugh are aware of the changes, just as a heads up.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedDec 7, 2023
edited
Loading

Heya@andrewbranch, I've started to run the tarball bundle task on this PR at989fa50. You can monitor the buildhere.

@typescript-bot
Copy link
Collaborator

typescript-bot commentedDec 7, 2023
edited
Loading

Hey@andrewbranch, I've packed this intoan installable tgz. You can install it for testing by referencing it in yourpackage.json like so:

{    "devDependencies": {        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/158991/artifacts?artifactName=tgz&fileId=95BBFD2778E2B6F0853A6F2EF1EAB1A4AF470C0AB105BAD2C44C6707C2F2A1D302&fileName=/typescript-5.4.0-insiders.20231207.tgz"    }}

and then runningnpm install.


There is also a playgroundfor this build and annpm module you can use via"typescript": "npm:@typescript-deploys/pr-build@5.4.0-pr-52968-11".;

@Andarist
Copy link
ContributorAuthor

superseded by#56794

@microsoftmicrosoft locked asresolvedand limited conversation to collaboratorsOct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

@sandersnsandersn

Labels

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Suggestion: Noninferential type parameter usage

6 participants

@Andarist@typescript-bot@sandersn@jakebailey@unional@andrewbranch

[8]ページ先頭

©2009-2025 Movatter.jp