We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75687b2 commit 8a629f2Copy full SHA for 8a629f2
crates/emmylua_code_analysis/src/db_index/type/types.rs
@@ -443,7 +443,21 @@ impl LuaTupleType {
443
}
444
445
pub fn get_type(&self, idx: usize) -> Option<&LuaType> {
446
- self.types.get(idx)
+ if let Some(ty) = self.types.get(idx) {
447
+ return Some(ty);
448
+ };
449
+
450
+ if self.types.is_empty() {
451
+ return None;
452
+ }
453
454
+ let last_id = self.types.len() - 1;
455
+ let last_type = self.types.get(last_id)?;
456
+ if let LuaType::Variadic(variadic) = last_type {
457
+ return variadic.get_type(idx - last_id);
458
459
460
+ None
461
462
463
pub fn len(&self) -> usize {
0 commit comments