bazel
bazel copied to clipboard
Refactor type resolver logic and type class hierarchy
Tracking issue for refactoring Resolver.java and the types/ subpackage.
- [x] The logic in the symbol resolver (
Resolver.java) for producingStarlarkTypes from type expressions, and for writing these types to aResolver.Function, should be spun off into a separate type resolver file. This simplifies the symbol resolver code and allows us to consider type resolution as a separate process, to be applied zero or more times after symbol resolution. - [x] The symbol resolver should set binding information for uses of bindings within type expressions, and should create new bindings for symbols introduced by
type Foo = Bardeclarations. - [ ] The type resolver should mutate the binding object to store its annotated
StarlarkType. - [ ] The type resolver should use binding information in type expressions to enable using user-defined types (global symbols rather than predeclareds / universals -- in particular type aliases).
This prepares the way for a basic static type checker.