Skip to content

SONARPY-1866 Infer types of reassigned parameters even when they don't have type annotationst have type annotations #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2024

Conversation

maksim-grebeniuk-sonarsource
Copy link
Contributor

No description provided.

Copy link
Contributor

@guillaume-dequenne guillaume-dequenne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -377,7 +377,7 @@ def foo(param):

var functionDef = (FunctionDef) root.statements().statements().get(0);
var lastExpressionStatement = (ExpressionStatement) functionDef.body().statements().get(functionDef.body().statements().size() -1);
Assertions.assertThat(lastExpressionStatement.expressions().get(0).typeV2().unwrappedType()).isEqualTo(PythonType.UNKNOWN);
Assertions.assertThat(lastExpressionStatement.expressions().get(0).typeV2().unwrappedType().name()).isEqualTo("str");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please compare to STR_TYPE directly instead of using name.

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube

@maksim-grebeniuk-sonarsource maksim-grebeniuk-sonarsource merged commit b6a156e into MMF-3796 May 21, 2024
@maksim-grebeniuk-sonarsource maksim-grebeniuk-sonarsource deleted the SONARPY-1866 branch May 21, 2024 14:47
guillaume-dequenne pushed a commit that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants