Skip to content

Refactor type resolver logic and type class hierarchy #27728

@brandjon

Description

@brandjon

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

  • 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.
  • 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.

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)team-Starlark-InterpreterIssues involving the Starlark interpreter used by Bazeltype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions