You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reveal_type(decorated_func_using) # E: Revealed type is 'def (param1: builtins.str, param2: builtins.int) -> builtins.bool'
27
+
28
+
class ClassWithAtomicMethod:
29
+
# Bare decorator
30
+
@transaction.atomic
31
+
def atomic_method1(self, abc: int) -> str:
32
+
pass
33
+
34
+
@transaction.atomic(savepoint=True)
35
+
def atomic_method2(self):
36
+
pass
37
+
38
+
@transaction.atomic(using="db", savepoint=True)
39
+
def atomic_method3(self, myparam: str) -> int:
40
+
pass
41
+
42
+
ClassWithAtomicMethod().atomic_method1("abc") # E: Argument 1 to "atomic_method1" of "ClassWithAtomicMethod" has incompatible type "str"; expected "int"
43
+
44
+
# Ensure that the method's type is preserved
45
+
reveal_type(ClassWithAtomicMethod().atomic_method1) # E: Revealed type is 'def (abc: builtins.int) -> builtins.str'
46
+
47
+
# Ensure that the method's type is preserved
48
+
reveal_type(ClassWithAtomicMethod().atomic_method3) # E: Revealed type is 'def (myparam: builtins.str) -> builtins.int'
0 commit comments