diff --git a/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java b/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java index d520c8386f05..7a9dd4f7127e 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java +++ b/python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java @@ -921,6 +921,7 @@ public class PyCallExpressionHelper { } else { parametersMappedToVariadicKeywordArguments.add(parameter); + mappedVariadicArgumentsToParameters = true; } } else { diff --git a/python/testData/inspections/PyArgumentListInspection/kwargsAgainstKeywordOnly.py b/python/testData/inspections/PyArgumentListInspection/kwargsAgainstKeywordOnly.py new file mode 100644 index 000000000000..cbe9a989988d --- /dev/null +++ b/python/testData/inspections/PyArgumentListInspection/kwargsAgainstKeywordOnly.py @@ -0,0 +1,10 @@ +def f1(arg): + return 2 + +def f2(*, arg): + return 2 + + +def test(**kwargs): + f1(**kwargs) + f2(**kwargs) diff --git a/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java index ccf903d425b9..97efabafbd04 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyArgumentListInspectionTest.java @@ -322,6 +322,11 @@ public class PyArgumentListInspectionTest extends PyTestCase { runWithLanguageLevel(LanguageLevel.PYTHON35, this::doTest); } + // PY-16968 + public void testKwargsAgainstKeywordOnly() { + runWithLanguageLevel(LanguageLevel.PYTHON36, this::doTest); + } + private void doMultiFileTest() { final String folderPath = "inspections/PyArgumentListInspection/" + getTestName(false) + "/";