From 3d2ce2e01ff2b2b2ba4ce8d5f9c345687aefe4ab Mon Sep 17 00:00:00 2001 From: Hoblovski Date: Thu, 13 Nov 2025 19:54:28 +0800 Subject: [PATCH 1/3] tests: add bad case --- test/completion/wtf.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/completion/wtf.py diff --git a/test/completion/wtf.py b/test/completion/wtf.py new file mode 100644 index 00000000..c5d54dbf --- /dev/null +++ b/test/completion/wtf.py @@ -0,0 +1,6 @@ +xy = (1,) +x, y = *xy, None + +# whatever it is should not crash +#? +x From 3454ebb1de2aef96821c4388738dcadc79afa0ae Mon Sep 17 00:00:00 2001 From: Hoblovski Date: Thu, 13 Nov 2025 20:41:58 +0800 Subject: [PATCH 2/3] fix: let star_expr infer to NO_VALUES instead of crashing --- jedi/inference/syntax_tree.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jedi/inference/syntax_tree.py b/jedi/inference/syntax_tree.py index 294fb7e4..043514a2 100644 --- a/jedi/inference/syntax_tree.py +++ b/jedi/inference/syntax_tree.py @@ -251,6 +251,8 @@ def _infer_node(context, element): return NO_VALUES elif typ == 'namedexpr_test': return context.infer_node(element.children[2]) + elif typ == 'star_expr': + return NO_VALUES else: return infer_or_test(context, element) From 1b33f0d77cd5c4111a56d0f279653ba49d289acc Mon Sep 17 00:00:00 2001 From: Hoblovski Date: Thu, 13 Nov 2025 21:12:15 +0800 Subject: [PATCH 3/3] fix: move test to arrays.py --- test/completion/arrays.py | 8 ++++++++ test/completion/wtf.py | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 test/completion/wtf.py diff --git a/test/completion/arrays.py b/test/completion/arrays.py index 21437bce..bb397f40 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -527,3 +527,11 @@ lc = [x for a, *x in [(1, '', 1.0)]] lc[0][0] #? lc[0][1] + + +xy = (1,) +x, y = *xy, None + +# whatever it is should not crash +#? +x diff --git a/test/completion/wtf.py b/test/completion/wtf.py deleted file mode 100644 index c5d54dbf..00000000 --- a/test/completion/wtf.py +++ /dev/null @@ -1,6 +0,0 @@ -xy = (1,) -x, y = *xy, None - -# whatever it is should not crash -#? -x