Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Acepie committed May 6, 2024
1 parent 7c163f5 commit b7a96bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion compiler-core/src/type_/tests/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ fn case_tuple_guard() {

#[test]
fn case_list_guard() {
assert_error!("case [1] { x if x == [1, 2.0] -> 1 }");
assert_error!("case [1] { x if x == [1, 2.0] -> 1 _ -> 2 }");
}

#[test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: "case [1] { x if x == [1, 2.0] -> 1 }"
expression: "case [1] { x if x == [1, 2.0] -> 1 _ -> 2 }"
---
error: Type mismatch
┌─ /src/one/two.gleam:1:26
1case [1] { x if x == [1, 2.0] -> 1 }
1case [1] { x if x == [1, 2.0] -> 1 _ -> 2 }
^^^

Expected type:
Expand All @@ -15,16 +15,3 @@ Expected type:
Found type:

Float

error: Inexhaustive patterns
┌─ /src/one/two.gleam:1:1
1case [1] { x if x == [1, 2.0] -> 1 }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This case expression does not have a pattern for all possible values.
If it is run on one of the values without a pattern then it will crash.

The missing patterns are:

_

0 comments on commit b7a96bf

Please sign in to comment.