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

[JIT] Resolve string literal type annotations using Resolver::resolveType #47731

Closed

Commits on Nov 11, 2020

  1. [JIT] Resolve string literal type annotations using `Resolver::resolv…

    …eType`
    
    **Summary**
    This commit modifies `ScriptTypeParser::parseTypeFromExpr` so that
    string literal type annotations are resolved using
    `Resolver::resolveType`. At present, they are parsed in
    `parseBaseTypeName`, which inadvertently allows any key from
    `string_to_type_lut` to be used as a string literal type annotation.
    
    **Test Plan**
    Existing unit tests (most notably
    `TestClassType.test_self_referential_method` which tests the main
    feature, self-referential class type annotations, that make use of
    string literal type annotations).
    
    **Fixes**
    This commit fixes #47570.
    
    [ghstack-poisoned]
    Meghan Lele committed Nov 11, 2020
    Configuration menu
    Copy the full SHA
    d33bfb2 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2020

  1. Update on "[JIT] Resolve string literal type annotations using `Resol…

    …ver::resolveType`"
    
    **Summary**
    This commit modifies `ScriptTypeParser::parseTypeFromExpr` so that
    string literal type annotations are resolved using
    `Resolver::resolveType`. At present, they are parsed in
    `parseBaseTypeName`, which inadvertently allows any key from
    `string_to_type_lut` to be used as a string literal type annotation.
    
    **Test Plan**
    Existing unit tests (most notably
    `TestClassType.test_self_referential_method` which tests the main
    feature, self-referential class type annotations, that make use of
    string literal type annotations).
    
    **Fixes**
    This commit fixes #47570.
    
    [ghstack-poisoned]
    Meghan Lele committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    0eac8d4 View commit details
    Browse the repository at this point in the history