|author||Vadim Shtayura <email@example.com>||Wed Dec 12 00:02:01 2018|
|committer||Commit Bot <firstname.lastname@example.org>||Wed Dec 12 00:02:01 2018|
[starlark] Add genstruct(...) and ctor(...) builtins. They can be used to create structs "tagged" with a symbol. It's not quite like a typed struct (each individual object still can have arbitrary fields), but pretty close: mystruct = genstruct("mystruct") s = mystruct(a=1, b=2) assert.eq(ctor(s), mystruct) assert.eq(ctor(1), None) assert.eq(ctor(struct(a=1, b=2)), "struct") Can be used to add some sort of type safety to Starlark libraries. Note that using type(strct) is insufficient, since it always returns "struct". Remail@example.com, firstname.lastname@example.org BUG=833946 Change-Id: I65abc0594441367a7ecd3c0faa05c06499d61c30 Reviewed-on: https://chromium-review.googlesource.com/c/1370693 Reviewed-by: Robbie Iannucci <email@example.com> Reviewed-by: Nodir Turakulov <firstname.lastname@example.org> Commit-Queue: Vadim Shtayura <email@example.com>
fetch infra cd infra/go eval `./env.py` cd src/go.chromium.org/luci
Contributing uses the same flow as Chromium contributions.