From 677e9a8d189223eb41a5d6b9605c0c85776428c5 Mon Sep 17 00:00:00 2001 From: Maksim Grebeniuk <122789225+maksim-grebeniuk-sonarsource@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:38:23 +0100 Subject: [PATCH] SONARPY-2360 Add unit test case on S5655 when compared types has decorators (#2173) --- .../src/test/resources/checks/argumentType.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python-checks/src/test/resources/checks/argumentType.py b/python-checks/src/test/resources/checks/argumentType.py index 560ad911c7..c682318f67 100644 --- a/python-checks/src/test/resources/checks/argumentType.py +++ b/python-checks/src/test/resources/checks/argumentType.py @@ -267,3 +267,14 @@ class EnumA(Enum): C = 3 len(EnumA) + +import dataclasses +@dataclasses.dataclass +class DecoratedDataClass: + x : int + +def decorated_dataclass_expected(data: DecoratedDataClass): ... +data = dataclasses.replace(DecoratedDataClass(42)) + +# FP SONARPY-2359 +decorated_dataclass_expected(data) # Noncompliant \ No newline at end of file