Skip to content

Commit af9c0a4

Browse files
committed
add another error message test
1 parent 89ee32a commit af9c0a4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/let_unwrap_return_type_mismatch.res:4:8-14
4+
5+
2 │
6+
3 │ let fn = (): int => {
7+
4 │ let? Some(x) = None
8+
5 │ 42
9+
6 │ }
10+
11+
This has type: option<'a>
12+
But this switch is expected to return: int
13+
14+
All branches in a switch must return the same type.
15+
To fix this, change your branch to return the expected type.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@@config({flags: ["-enable-experimental", "LetUnwrap"]})
2+
3+
let fn = (): int => {
4+
let? Some(x) = None
5+
42
6+
}

0 commit comments

Comments
 (0)