File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
crates/emmylua_code_analysis/src/compilation/analyzer/flow/bind_analyze Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,18 @@ pub fn bind_analyze(binder: &mut FlowBinder, chunk: LuaChunk) -> Option<()> {
3333
3434fn bind_block ( binder : & mut FlowBinder , block : LuaBlock , current : FlowId ) -> FlowId {
3535 let mut return_flow_id = current;
36+ let mut can_change_flow = true ;
3637 for node in block. children :: < LuaAst > ( ) {
37- return_flow_id = bind_node ( binder, node, return_flow_id) ;
38+ let node_flow_id = bind_node ( binder, node, return_flow_id) ;
39+ if can_change_flow {
40+ return_flow_id = node_flow_id;
41+ }
42+
3843 if let Some ( flow_node) = binder. get_flow ( return_flow_id) {
3944 match & flow_node. kind {
4045 FlowNodeKind :: Return | FlowNodeKind :: Break => {
4146 return_flow_id = binder. unreachable ;
42- break ;
47+ can_change_flow = false ;
4348 }
4449 _ => { }
4550 }
You can’t perform that action at this time.
0 commit comments