Skip to content

Commit 05a66a9

Browse files
committed
update
1 parent 5899c2d commit 05a66a9

4 files changed

Lines changed: 3 additions & 7 deletions

File tree

crates/emmylua_code_analysis/src/compilation/analyzer/lua/stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn analyze_local_stat(analyzer: &mut LuaAnalyzer, local_stat: LuaLocalStat)
2727
analyzer
2828
.db
2929
.get_type_index_mut()
30-
.bind_type(decl_id.into(), LuaTypeCache::InferType(LuaType::Unknown));
30+
.bind_type(decl_id.into(), LuaTypeCache::InferType(LuaType::Nil));
3131
}
3232

3333
return Some(());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ end
461461
);
462462

463463
let b = ws.expr_ty("b");
464-
let b_expected = ws.ty("unknown");
464+
let b_expected = ws.ty("nil");
465465
assert_eq!(b, b_expected);
466466
}
467467

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ mod test {
4747
"#,
4848
);
4949
let left = ws.expr_ty("d");
50-
println!("{:?}", ws.humanize_type(left));
51-
// assert_eq!(ws.humanize_type(left), "1?");
50+
assert_eq!(ws.humanize_type(left), "nil");
5251
}
5352

5453
#[test]

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ mod test {
1212
assert!(ws.check_code_for(
1313
DiagnosticCode::UnnecessaryAssert,
1414
r#"
15-
local a
16-
assert(a)
17-
1815
---@type boolean
1916
local b
2017
assert(b)

0 commit comments

Comments
 (0)