Skip to content

Commit 3a767fd

Browse files
committed
Revert "fix #405"
This reverts commit 87fbbb2.
1 parent cce99ca commit 3a767fd

File tree

3 files changed

+1
-53
lines changed

3 files changed

+1
-53
lines changed

crates/emmylua_code_analysis/src/compilation/analyzer/flow/var_analyze/broadcast_up.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use std::sync::Arc;
22

33
use emmylua_parser::{
4-
BinaryOperator, LuaAst, LuaAstNode, LuaBinaryExpr, LuaExpr, LuaForStat, LuaLiteralToken,
5-
UnaryOperator,
4+
BinaryOperator, LuaAst, LuaAstNode, LuaBinaryExpr, LuaExpr, LuaLiteralToken, UnaryOperator,
65
};
76
use smol_str::SmolStr;
87

@@ -185,17 +184,6 @@ pub fn broadcast_up(
185184
);
186185
}
187186
}
188-
UnaryOperator::OpLen => {
189-
if let Some(for_stat) = unary_expr.get_parent::<LuaForStat>() {
190-
broadcast_inside_condition_block(
191-
db,
192-
var_trace,
193-
trace_info.with_type_assertion(TypeAssertion::Narrow(LuaType::Table)),
194-
for_stat.get_block()?,
195-
false,
196-
);
197-
}
198-
}
199187
_ => {}
200188
}
201189
}

crates/emmylua_code_analysis/src/compilation/test/flow.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -617,24 +617,4 @@ end
617617
let b_expected = ws.ty("string[]");
618618
assert_eq!(b, b_expected);
619619
}
620-
621-
#[test]
622-
fn test_issue_405() {
623-
let mut ws = VirtualWorkspace::new();
624-
625-
ws.def(
626-
r#"
627-
---@type false|fun(...)[]?
628-
local calls
629-
630-
for i = 1, #calls do
631-
a = calls
632-
end
633-
"#,
634-
);
635-
636-
let a = ws.expr_ty("a");
637-
let a_expected = ws.ty("fun(...)[]");
638-
assert_eq!(a, a_expected);
639-
}
640620
}

crates/emmylua_code_analysis/src/diagnostic/test/need_check_nil_test.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@ mod test {
1414
"#
1515
));
1616
}
17-
18-
#[test]
19-
fn test_issue_405() {
20-
let mut ws = VirtualWorkspace::new();
21-
let mut emmyrc = ws.analysis.emmyrc.as_ref().clone();
22-
emmyrc.strict.array_index = false;
23-
ws.analysis.update_config(emmyrc.into());
24-
assert!(ws.check_code_for(
25-
DiagnosticCode::NeedCheckNil,
26-
r#"
27-
---@type false|fun(...)[]?
28-
local calls
29-
30-
for i = 1, #calls do
31-
calls[i](...)
32-
end
33-
"#
34-
));
35-
}
36-
3717
#[test]
3818
fn test_issue_402() {
3919
let mut ws = VirtualWorkspace::new();

0 commit comments

Comments
 (0)