Skip to content

Conversation

@lankaapura
Copy link
Contributor

Fixes#21716, pls review and let me know if there any changes required.

@mhegazymhegazy merged commit 79dde93 into microsoft:masterFeb 8, 2018
@mhegazy
Copy link
Contributor

thanks!

@mhegazy
Copy link
Contributor

Do you wana get the support for infer as well.. e.g.:

typeC<T>=TextendsArray< infer U>? U : T;

@lankaapura
Copy link
ContributorAuthor

@mhegazyI've created a test and it seems this is not related to conditional type formatting. The reason is there are no infer formatting rules defined yet.

How do I proceed? Do you want me to update this PR or are you going to create a new issue?

Code : "type C< T > = T extends Array < infer U >" Expected : "type C<T> = T extends Array<infer U>" Actual : "type C<T> = T extends Array<infer U>" 
Code : "type C< T > = T extends Array < infer U > ? U : T;" Expected : "type C<T> = T extends Array<infer U> ? U : T;" Actual : "type C<T> = T extends Array<infer U> ? U : T;" 

Do you know where can I find more details about infer keyword and examples?

@mhegazy
Copy link
Contributor

it seems this is not related to conditional type formatting.

that is correct. the new keyword was added with conditional types, and is only allowed within the extends clause of a conditional type.

The reason is there are no infer formatting rules defined yet.

that is correct

How do I proceed? Do you want me to update this PR or are you going to create a new issue?

If you are interested you can just send a new PR for infer formatting.

Do you know where can I find more details about infer keyword and examples?

Here is the PR that added it: #21496

@lankaapuralankaapura mentioned this pull request Feb 10, 2018
@lankaapuralankaapura deleted the Fix-21716 branch February 10, 2018 05:35
@microsoftmicrosoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@lankaapura@mhegazy