bazelbuild / bazelbuild/bazel

Migrate static Types class to TypeContext

Open
#28,638 1 comment 0 reactions 0 assignees View on GitHub
P1 team-Starlark-Interpreter type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

Currently, hardcoded types like `list` are accessed on a namespace class `Types`. This makes it difficult to programmatically construct types with field/method APIs, e.g. adding `append()` as a method of `list`.

We should refactor the injectable types into an interface, and have `BuiltinManager` implement the interface. Then we can thread that object through parts of the code that need to construct such types.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the static Types namespace is accessed and how BuiltinManager currently provides injectable types. Review the TypeContext design and the field/method APIs before deciding where the object must be threaded. Done means the injectable types use an interface implemented by BuiltinManager and callers can construct types such as list with additional methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.