@@ -160,7 +160,7 @@ def generate_native_function(
160
160
# eliminated during code generation.
161
161
for block in fn .blocks :
162
162
terminator = block .terminator
163
- assert isinstance (terminator , ControlOp )
163
+ assert isinstance (terminator , ControlOp ), terminator
164
164
165
165
for target in terminator .targets ():
166
166
is_next_block = target .label == block .label + 1
@@ -309,7 +309,7 @@ def visit_assign(self, op: Assign) -> None:
309
309
310
310
def visit_assign_multi (self , op : AssignMulti ) -> None :
311
311
typ = op .dest .type
312
- assert isinstance (typ , RArray )
312
+ assert isinstance (typ , RArray ), typ
313
313
dest = self .reg (op .dest )
314
314
# RArray values can only be assigned to once, so we can always
315
315
# declare them on initialization.
@@ -586,7 +586,7 @@ def visit_method_call(self, op: MethodCall) -> None:
586
586
def emit_method_call (self , dest : str , op_obj : Value , name : str , op_args : list [Value ]) -> None :
587
587
obj = self .reg (op_obj )
588
588
rtype = op_obj .type
589
- assert isinstance (rtype , RInstance )
589
+ assert isinstance (rtype , RInstance ), rtype
590
590
class_ir = rtype .class_ir
591
591
method = rtype .class_ir .get_method (name )
592
592
assert method is not None
@@ -805,7 +805,7 @@ def visit_get_element_ptr(self, op: GetElementPtr) -> None:
805
805
dest = self .reg (op )
806
806
src = self .reg (op .src )
807
807
# TODO: support tuple type
808
- assert isinstance (op .src_type , RStruct )
808
+ assert isinstance (op .src_type , RStruct ), op . src_type
809
809
assert op .field in op .src_type .names , "Invalid field name."
810
810
self .emit_line (
811
811
"{} = ({})&(({} *){})->{};" .format (
0 commit comments