[JIT] Resolve string literal type annotations using `Resolver::resolveType` (#47731)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47731
**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.
Test Plan: Imported from OSS
Reviewed By: navahgar
Differential Revision: D24934717
Pulled By: SplitInfinity
fbshipit-source-id: b915b2c08272566b63b3cf5ff4a07ad43bdc381a