Skip to content

Commit 04cac4b

Browse files
authored
[mypyc] Add helpful message to assert (#12119)
1 parent 84b9778 commit 04cac4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypyc/irbuild/prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def prepare_method_def(ir: ClassIR, module_name: str, cdef: ClassDef, mapper: Ma
142142
ir.method_decls[PROPSET_PREFIX + node.name] = decl
143143

144144
if node.func.is_property:
145-
assert node.func.type
145+
assert node.func.type, f"Expected return type annotation for property '{node.name}'"
146146
decl.is_prop_getter = True
147147
ir.property_types[node.name] = decl.sig.ret_type
148148

0 commit comments

Comments
 (0)