Skip to content
Navigation Menu
Toggle navigation
Sign in
Appearance settings
Platform
GitHub Copilot
Write better code with AI
GitHub Spark
New
Build and deploy intelligent apps
GitHub Models
New
Manage and compare prompts
GitHub Advanced Security
Find and fix vulnerabilities
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Discussions
Collaborate outside of code
Code Search
Find more, search less
Explore
Why GitHub
Documentation
GitHub Skills
Blog
Integrations
GitHub Marketplace
MCP Registry
View all features
Solutions
By company size
Enterprises
Small and medium teams
Startups
Nonprofits
By use case
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
By industry
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
Topics
AI
DevOps
Security
Software Development
View all
Explore
Learning Pathways
Events & Webinars
Ebooks & Whitepapers
Customer Stories
Partners
Executive Insights
Open Source
GitHub Sponsors
Fund open source developers
The ReadME Project
GitHub community articles
Repositories
Topics
Trending
Collections
Enterprise
Enterprise platform
AI-powered developer platform
Available add-ons
GitHub Advanced Security
Enterprise-grade security features
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search or jump to...
Search code, repositories, users, issues, pull requests...
Search syntax tips
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign in
Sign up
Appearance settings
Resetting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
microsoft
/
TypeScript
Public
Notifications
You must be signed in to change notification settings
Fork
13.1k
Star
107k
Code
Issues
5k+
Pull requests
509
Actions
Projects
1
Models
Wiki
Security
Uh oh!
There was an error while loading.
Please reload this page
.
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Models
Wiki
Security
Insights
Discriminated union types
#9163
Merged
ahejlsberg
merged 6 commits into
master
microsoft/TypeScript:master
from
typeGuardDiscriminants
microsoft/TypeScript:typeGuardDiscriminants
Copy head branch name to clipboard
Jun 17, 2016
Conversation
Commits
6
(6)
Checks
Files changed
Merged
Discriminated union types
#9163
ahejlsberg
merged 6 commits into
master
microsoft/TypeScript:master
from
typeGuardDiscriminants
microsoft/TypeScript:typeGuardDiscriminants
Copy head branch name to clipboard
Commits
Commits on Jun 10, 2016
Type guards using discriminant properties of string literal types
ahejlsberg
committed
4a8f94a
Copy full SHA for 4a8f94a
Commits on Jun 13, 2016
Narrow type in case/default sections in switch on discriminant property
ahejlsberg
committed
ce15646
Copy full SHA for ce15646
No implicit returns following exhaustive switch statements
ahejlsberg
committed
c90b0fe
Copy full SHA for c90b0fe
Commits on Jun 14, 2016
Narrow non-union types to ensure consistent results
ahejlsberg
committed
00376f4
Copy full SHA for 00376f4
Add tests
ahejlsberg
committed
5ff7c29
Copy full SHA for 5ff7c29
Merge branch 'master' into typeGuardDiscriminants
Show description for a3635cc
ahejlsberg
committed
a3635cc
Copy full SHA for a3635cc
You can’t perform that action at this time.