Skip to content

Add support for type annotations in assignments#1403

Merged
vladmos merged 2 commits intobazelbuild:mainfrom
laurentlb:master
Oct 31, 2025
Merged

Add support for type annotations in assignments#1403
vladmos merged 2 commits intobazelbuild:mainfrom
laurentlb:master

Conversation

@laurentlb
Copy link
Contributor

@laurentlb laurentlb commented Oct 14, 2025

Type annotations are already supported in function declarations (since #900). Supporting it in assignments is something users expect too (already supported in Starlark-Rust).

e.g.
s: str = "hello"

Fixes #1381

@tetromino
Copy link

tetromino commented Oct 28, 2025

FYI, @brandjon is literally in the middle of merging support for identifier : T = value and identifier : T statement syntax in Bazel's Starlark parser.

Edit: and it was merged into Bazel as bazelbuild/bazel@5c8655c

Copy link
Member

@vladmos vladmos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vladmos vladmos merged commit f48b234 into bazelbuild:main Oct 31, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support inline type annotations

3 participants