Skip to content

Commit 67c4e5c

Browse files
committed
Fix #796
1 parent 763bb55 commit 67c4e5c

File tree

1 file changed

+13
-2
lines changed
  • crates/emmylua_code_analysis/src/db_index/type

1 file changed

+13
-2
lines changed

crates/emmylua_code_analysis/src/db_index/type/types.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,19 @@ impl LuaType {
448448
let mut result_types = Vec::new();
449449
let mut hash_set = HashSet::new();
450450
for typ in types {
451-
if hash_set.insert(typ.clone()) {
452-
result_types.push(typ);
451+
match typ {
452+
LuaType::Union(u) => {
453+
for t in u.into_vec() {
454+
if hash_set.insert(t.clone()) {
455+
result_types.push(t);
456+
}
457+
}
458+
}
459+
_ => {
460+
if hash_set.insert(typ.clone()) {
461+
result_types.push(typ);
462+
}
463+
}
453464
}
454465
}
455466

0 commit comments

Comments
 (0)