File tree Expand file tree Collapse file tree 2 files changed +276
-240
lines changed
rust/ql/test/library-tests/type-inference Expand file tree Collapse file tree 2 files changed +276
-240
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,27 @@ mod m9 {
432432
433433 let x6 = MyOption :: MySome ( MyOption :: < S > :: MyNone ( ) ) ;
434434 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) ;
435456 }
436457}
437458
You can’t perform that action at this time.
0 commit comments