bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Refactor type resolver logic and type class hierarchy

Open brandjon opened this issue 1 month ago • 0 comments

Tracking issue for refactoring Resolver.java and the types/ subpackage.

  • [x] The logic in the symbol resolver (Resolver.java) for producing StarlarkTypes from type expressions, and for writing these types to a Resolver.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 = Bar declarations.
  • [ ] 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.

brandjon avatar Nov 19 '25 15:11 brandjon