Skip to content
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 44 commits into from
Nov 10, 2015
Merged

String literal types #5185

merged 44 commits into from
Nov 10, 2015

Commits on Sep 26, 2015

  1. Added tests.

    DanielRosenwasser committed Sep 26, 2015
    Configuration menu
    Copy the full SHA
    311a0cf View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2015

  1. Configuration menu
    Copy the full SHA
    911e907 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f04cc39 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    191be4f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    84786d8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dc0e368 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8891fba View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    82545ce View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ed927d8 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2015

  1. Configuration menu
    Copy the full SHA
    a3e7ccb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    20c2c4e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    87f2957 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f721971 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7b4e94d View commit details
    Browse the repository at this point in the history
  6. 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.
    DanielRosenwasser committed Oct 2, 2015
    Configuration menu
    Copy the full SHA
    d8d72aa View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    315b06d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4b736da View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fd5dec4 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2015

  1. Added more tests.

    DanielRosenwasser committed Oct 7, 2015
    Configuration menu
    Copy the full SHA
    f7a6ac7 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2015

  1. Configuration menu
    Copy the full SHA
    a440f06 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d2e2a55 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6e3343c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    74ac57d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    61ece76 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    84b64c4 View commit details
    Browse the repository at this point in the history
  7. Semicolon.

    DanielRosenwasser committed Oct 8, 2015
    Configuration menu
    Copy the full SHA
    3788254 View commit details
    Browse the repository at this point in the history
  8. Linting.

    DanielRosenwasser committed Oct 8, 2015
    Configuration menu
    Copy the full SHA
    ebc47d5 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2015

  1. Configuration menu
    Copy the full SHA
    725bda8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ec0d49a View commit details
    Browse the repository at this point in the history
  3. Accepted baselines.

    DanielRosenwasser committed Oct 15, 2015
    Configuration menu
    Copy the full SHA
    1dbd8d1 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2015

  1. Configuration menu
    Copy the full SHA
    307d73e View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2015

  1. Configuration menu
    Copy the full SHA
    049d02f View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2015

  1. Configuration menu
    Copy the full SHA
    6618fd2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bf4880a View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2015

  1. Accepted baselines.

    DanielRosenwasser committed Oct 27, 2015
    Configuration menu
    Copy the full SHA
    5e23143 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2015

  1. Configuration menu
    Copy the full SHA
    8dbfe1c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a1fcfaf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bb232f7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f939ff2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d234b8d View commit details
    Browse the repository at this point in the history
  6. Const.

    DanielRosenwasser committed Nov 6, 2015
    Configuration menu
    Copy the full SHA
    c011ed4 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2015

  1. Configuration menu
    Copy the full SHA
    38090c6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d294524 View commit details
    Browse the repository at this point in the history
  3. Fixed comments.

    DanielRosenwasser committed Nov 9, 2015
    Configuration menu
    Copy the full SHA
    ea4e21d View commit details
    Browse the repository at this point in the history