Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf0b3b5 commit 8230483Copy full SHA for 8230483
2 files changed
rust/ql/test/library-tests/type-inference/main.rs
@@ -432,6 +432,27 @@ mod m9 {
432
433
let x6 = MyOption::MySome(MyOption::<S>::MyNone());
434
println!("{:?}", MyOption::<MyOption<S>>::flatten(x6));
435
+
436
+ let from_if = if 1 + 1 > 2 {
437
+ MyOption::MyNone() // missing type `S` at `T``
438
+ } else {
439
+ MyOption::MySome(S)
440
+ };
441
+ println!("{:?}", from_if);
442
443
+ let from_match = match 1 + 1 > 2 {
444
+ true => MyOption::MyNone(), // missing type `S` at `T``
445
+ false => MyOption::MySome(S),
446
447
+ println!("{:?}", from_match);
448
449
+ let from_loop = loop {
450
+ if 1 + 1 > 2 {
451
+ break MyOption::MyNone(); // missing type `S` at `T``
452
+ }
453
+ break MyOption::MySome(S);
454
455
+ println!("{:?}", from_loop);
456
}
457
458
0 commit comments