Skip to content

Disallow void branches - #7261

Closed
Daniel Rosenwasser (DanielRosenwasser) wants to merge 7 commits into
masterfrom
noVoidBranches
Closed

Daniel Rosenwasser (DanielRosenwasser) wants to merge 7 commits into
masterfrom
noVoidBranches

Conversation

@DanielRosenwasser

Copy link
Copy Markdown
Member

Fixes #7256

Open questions:

Should we cover null/undefined types?

TODO:

  • Conditional expressions
  • Negation expressions.


==== tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorWithEveryType.ts (10 errors) ====
// The && operator permits the operands to be of any type and produces a result of the same
// type as the second operand.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This might need to be updated. Should I split these tests up so we can observe the types of other expressions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes

@sandersn

Copy link
Copy Markdown
Member

Why didn't we check this before? This seems fundamental to the type of binary logical operators.

@jeffreymorlan

Copy link
Copy Markdown
Contributor

void expressions should also be disallowed on the right side of !, I think.

@DanielRosenwasser

Copy link
Copy Markdown
Member Author

jeffreymorlan that's not a bad idea either. Thanks!

@RyanCavanaugh

Copy link
Copy Markdown
Member

👍 and ✅

@mhegazy

Mohamed Hegazy (mhegazy) commented Apr 26, 2016 •

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) can you update this PR.

@mhegazy

Copy link
Copy Markdown
Contributor

Daniel Rosenwasser (@DanielRosenwasser) can you update and merge this time :)

@mhegazy

Copy link
Copy Markdown
Contributor

Thanks for your contribution. This PR has failing CI tests and can not be merged in at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to merge this code in, please open a new PR that has been merged and rebased with the master branch.

@mhegazy
Mohamed Hegazy (mhegazy) deleted the noVoidBranches branch November 2, 2017 21:02
@microsoft 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.

6 participants