Skip to content

Commit

Permalink
report resolved value in err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
kgutwin committed May 23, 2024
1 parent 65bbdfd commit f82db43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions prqlc/prqlc/src/semantic/resolver/transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Resolver<'_> {
"right" => JoinSide::Right,
"full" => JoinSide::Full,

found => {
_ => {
// if that fails, fold the ident and try treating the result as a literal
// this allows the join side to be passed as a function parameter
// NOTE: this is temporary, pending discussions and implementation, tracked in #4501
Expand All @@ -132,7 +132,7 @@ impl Resolver<'_> {
return Err(Error::new(Reason::Expected {
who: Some("`side`".to_string()),
expected: "inner, left, right or full".to_string(),
found: found.to_string(),
found: folded.to_string(),
})
.with_span(span))
}
Expand Down
4 changes: 2 additions & 2 deletions prqlc/prqlc/tests/integration/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ fn test_join_side_literal_err() {
5 │ join y (==id) side:my_side
│ ───┬───
│ ╰───── `side` expected inner, left, right or full, but found my_side
│ ╰───── `side` expected inner, left, right or full, but found 42
───╯
"###);
}
Expand Down Expand Up @@ -2454,7 +2454,7 @@ fn test_join_side_literal_via_func_err() {
3 │ join side:_param.s m (c == that.k) tbl
│ ─┬
│ ╰── `side` expected inner, left, right or full, but found _param.s
│ ╰── `side` expected inner, left, right or full, but found "four"
───╯
"###);
}
Expand Down

0 comments on commit f82db43

Please sign in to comment.