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

Appearance settings

elaborate check before converting fresh literal type to regular#12595

Merged
vladima merged 1 commit into
mastermicrosoft/TypeScript:masterfrom
vladima/12584microsoft/TypeScript:vladima/12584Copy head branch name to clipboard
Dec 12, 2016
Merged

elaborate check before converting fresh literal type to regular#12595
vladima merged 1 commit into
mastermicrosoft/TypeScript:masterfrom
vladima/12584microsoft/TypeScript:vladima/12584Copy head branch name to clipboard

Conversation

@vladima

@vladima vladima commented Dec 1, 2016

Copy link
Copy Markdown
Contributor

fixes #12584

@vladima

vladima commented Dec 1, 2016

Copy link
Copy Markdown
Contributor Author

@mhegazy can you please take a look? Once this one is ok to go I'll port it into release-2.1.

Comment thread src/compiler/checker.ts
// at this point we know that this is union or intersection type possibly with nullable constituents.
// check if we still will have compound type if we ignore nullable components.
let seenNonNullable = false;
for (const t of (<UnionOrIntersectionType>type).types) {

@mhegazy mhegazy Dec 12, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not this just maybeTypeOfKind(type, ~TypeFlags.Nullable)?

@vladima vladima Dec 12, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, since AFAIR maybeTypeOfKind(type, ~TypeFlags.Nullable) will return true for union or intersection type that consist of non-nullable type and nullable type and this is not what we want.

@vladima vladima merged commit d050673 into master Dec 12, 2016
@vladima vladima deleted the vladima/12584 branch December 12, 2016 20:37
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to 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.

Code used to work but doesn't in nightly

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.