-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/eval: fix interpolation of numbers
Fixes #487 Change-Id: I0a8b0e45cf9d161a8683864764b969d20306fd94 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6948 Reviewed-by: CUE cueckoo <cueckoo@gmail.com> Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
- Loading branch information
Showing
7 changed files
with
95 additions
and
20 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
-- in.cue -- | ||
t1: { | ||
#R: { | ||
pos: uint | ||
name: "hello_\(pos)" | ||
} | ||
a: #R & {pos: 67} | ||
} | ||
t2: { | ||
#R: { | ||
pos: string | ||
name: "hello_\(pos)" | ||
} | ||
a: #R & {pos: "a"} | ||
} | ||
-- out/eval -- | ||
(struct){ | ||
t1: (struct){ | ||
#R: (#struct){ | ||
pos: (int){ &(>=0, int) } | ||
name: (_|_){ | ||
// [incomplete] t1.#R.name: invalid interpolation: non-concrete value >=0 & int (type int): | ||
// ./in.cue:4:9 | ||
} | ||
} | ||
a: (#struct){ | ||
pos: (int){ 67 } | ||
name: (string){ "hello_67" } | ||
} | ||
} | ||
t2: (struct){ | ||
#R: (#struct){ | ||
pos: (string){ string } | ||
name: (_|_){ | ||
// [incomplete] t2.#R.name: invalid interpolation: non-concrete value string (type string): | ||
// ./in.cue:11:9 | ||
} | ||
} | ||
a: (#struct){ | ||
pos: (string){ "a" } | ||
name: (string){ "hello_a" } | ||
} | ||
} | ||
} | ||
-- out/compile -- | ||
--- in.cue | ||
{ | ||
t1: { | ||
#R: { | ||
pos: &(int, >=0) | ||
name: "hello_\(〈0;pos〉)" | ||
} | ||
a: (〈0;#R〉 & { | ||
pos: 67 | ||
}) | ||
} | ||
t2: { | ||
#R: { | ||
pos: string | ||
name: "hello_\(〈0;pos〉)" | ||
} | ||
a: (〈0;#R〉 & { | ||
pos: "a" | ||
}) | ||
} | ||
} |
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