-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String literal types #5185
Merged
Merged
String literal types #5185
Commits on Sep 26, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 311a0cf - Browse repository at this point
Copy the full SHA 311a0cfView commit details
Commits on Oct 1, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 911e907 - Browse repository at this point
Copy the full SHA 911e907View commit details -
Configuration menu - View commit details
-
Copy full SHA for f04cc39 - Browse repository at this point
Copy the full SHA f04cc39View commit details -
Configuration menu - View commit details
-
Copy full SHA for 191be4f - Browse repository at this point
Copy the full SHA 191be4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 84786d8 - Browse repository at this point
Copy the full SHA 84786d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc0e368 - Browse repository at this point
Copy the full SHA dc0e368View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8891fba - Browse repository at this point
Copy the full SHA 8891fbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 82545ce - Browse repository at this point
Copy the full SHA 82545ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed927d8 - Browse repository at this point
Copy the full SHA ed927d8View commit details
Commits on Oct 2, 2015
-
Configuration menu - View commit details
-
Copy full SHA for a3e7ccb - Browse repository at this point
Copy the full SHA a3e7ccbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20c2c4e - Browse repository at this point
Copy the full SHA 20c2c4eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 87f2957 - Browse repository at this point
Copy the full SHA 87f2957View commit details -
Configuration menu - View commit details
-
Copy full SHA for f721971 - Browse repository at this point
Copy the full SHA f721971View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b4e94d - Browse repository at this point
Copy the full SHA 7b4e94dView commit details -
Separated the concept of apparent types from contextual types for str…
…ing literal types. In most cases, expressions are interested in the apparent type of the contextual type. For instance: var x = { hasOwnProperty(prop) { /* ... */ }; In the above, 'prop' should be contextually typed as 'string' from the signature of 'hasOwnProperty' in the global 'Object' type. However, in the case of string literal types, we don't want to get the apparent type after fetching the contextual type. This is because the apparent type of the '"onload"' string literal type is the global 'String' type. This has adverse effects in simple assignments like the following: let x: "onload" = "onload"; In this example, the right-hand side of the assignment will grab the type of 'x'. After figuring out the type is "onload", we then get the apparent type which is 'String'. This is problematic because when we then check the assignment itself, 'String's are not assignable to '"onload"'s. So in this case, we grab the contextual type *without* getting its apparent type.
Configuration menu - View commit details
-
Copy full SHA for d8d72aa - Browse repository at this point
Copy the full SHA d8d72aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 315b06d - Browse repository at this point
Copy the full SHA 315b06dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b736da - Browse repository at this point
Copy the full SHA 4b736daView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd5dec4 - Browse repository at this point
Copy the full SHA fd5dec4View commit details
Commits on Oct 7, 2015
-
Configuration menu - View commit details
-
Copy full SHA for f7a6ac7 - Browse repository at this point
Copy the full SHA f7a6ac7View commit details
Commits on Oct 8, 2015
-
Configuration menu - View commit details
-
Copy full SHA for a440f06 - Browse repository at this point
Copy the full SHA a440f06View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2e2a55 - Browse repository at this point
Copy the full SHA d2e2a55View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e3343c - Browse repository at this point
Copy the full SHA 6e3343cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74ac57d - Browse repository at this point
Copy the full SHA 74ac57dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61ece76 - Browse repository at this point
Copy the full SHA 61ece76View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84b64c4 - Browse repository at this point
Copy the full SHA 84b64c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3788254 - Browse repository at this point
Copy the full SHA 3788254View commit details -
Configuration menu - View commit details
-
Copy full SHA for ebc47d5 - Browse repository at this point
Copy the full SHA ebc47d5View commit details
Commits on Oct 15, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 725bda8 - Browse repository at this point
Copy the full SHA 725bda8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec0d49a - Browse repository at this point
Copy the full SHA ec0d49aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dbd8d1 - Browse repository at this point
Copy the full SHA 1dbd8d1View commit details
Commits on Oct 22, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 307d73e - Browse repository at this point
Copy the full SHA 307d73eView commit details
Commits on Oct 23, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 049d02f - Browse repository at this point
Copy the full SHA 049d02fView commit details
Commits on Oct 26, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 6618fd2 - Browse repository at this point
Copy the full SHA 6618fd2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf4880a - Browse repository at this point
Copy the full SHA bf4880aView commit details
Commits on Oct 27, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 5e23143 - Browse repository at this point
Copy the full SHA 5e23143View commit details
Commits on Nov 6, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 8dbfe1c - Browse repository at this point
Copy the full SHA 8dbfe1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a1fcfaf - Browse repository at this point
Copy the full SHA a1fcfafView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb232f7 - Browse repository at this point
Copy the full SHA bb232f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f939ff2 - Browse repository at this point
Copy the full SHA f939ff2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d234b8d - Browse repository at this point
Copy the full SHA d234b8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c011ed4 - Browse repository at this point
Copy the full SHA c011ed4View commit details
Commits on Nov 9, 2015
-
Configuration menu - View commit details
-
Copy full SHA for 38090c6 - Browse repository at this point
Copy the full SHA 38090c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for d294524 - Browse repository at this point
Copy the full SHA d294524View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea4e21d - Browse repository at this point
Copy the full SHA ea4e21dView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.