starlark icon indicating copy to clipboard operation
starlark copied to clipboard

Spec incorrectly claims that strings are treated as sequences in compound assignment

Open haberman opened this issue 1 year ago • 2 comments

The spec contains this example in assignments:

[(a, b), (c, d)] = ("ab", "cd")

However, this statement is rejected by both Bazel and https://github.com/google/starlark-go

Bazel:

ERROR: Traceback (most recent call last):
	File "/Users/haberman/bazel_workspace/test.bzl", line 27, column 8, in <toplevel>
		print(f())
	File "/Users/haberman/bazel_workspace/test.bzl", line 24, column 20, in f
		[(a, b), (c, d)] = ("ab", "cd")
Error: got 'string' in sequence assignment (want 2-element sequence)

starlark-go:

Traceback (most recent call last):
  test.bzl:27:8: in <toplevel>
  test.bzl:24:20: in f
Error: got string in sequence assignment

haberman avatar Jul 18 '24 02:07 haberman

Thanks, the example looks wrong to me, it should be removed.

laurentlb avatar Jul 18 '24 10:07 laurentlb

Hello! I would like to contribute. Can anyone tell me how to get started?

joydeep049 avatar Aug 13 '24 17:08 joydeep049