-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/fix: rewrite list addition and multiplication
Arithmetic on lists hasn't been part of the spec since 2021. We want to remove support for it. Teach `cue fix` to detect and rewrite: - list addition, which becomes a call to `list.Concat` - list multiplication, which becomes a call to `list.Repeat` These fixes are not perfect because `cue fix` has no access to type information and so only cases where there is a literal list can be fixed. Fixes #2237. Signed-off-by: Matthew Sackman <matthew@cue.works> Change-Id: I99946833277cda5de8004a30d5e4f909cfcc1016 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200212 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
- Loading branch information
1 parent
b123f2b
commit 3d36560
Showing
2 changed files
with
98 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters