@@ -160,7 +160,7 @@ def generate_native_function(
160160 # eliminated during code generation.
161161 for block in fn .blocks :
162162 terminator = block .terminator
163- assert isinstance (terminator , ControlOp )
163+ assert isinstance (terminator , ControlOp ), terminator
164164
165165 for target in terminator .targets ():
166166 is_next_block = target .label == block .label + 1
@@ -309,7 +309,7 @@ def visit_assign(self, op: Assign) -> None:
309309
310310 def visit_assign_multi (self , op : AssignMulti ) -> None :
311311 typ = op .dest .type
312- assert isinstance (typ , RArray )
312+ assert isinstance (typ , RArray ), typ
313313 dest = self .reg (op .dest )
314314 # RArray values can only be assigned to once, so we can always
315315 # declare them on initialization.
@@ -586,7 +586,7 @@ def visit_method_call(self, op: MethodCall) -> None:
586586 def emit_method_call (self , dest : str , op_obj : Value , name : str , op_args : list [Value ]) -> None :
587587 obj = self .reg (op_obj )
588588 rtype = op_obj .type
589- assert isinstance (rtype , RInstance )
589+ assert isinstance (rtype , RInstance ), rtype
590590 class_ir = rtype .class_ir
591591 method = rtype .class_ir .get_method (name )
592592 assert method is not None
@@ -805,7 +805,7 @@ def visit_get_element_ptr(self, op: GetElementPtr) -> None:
805805 dest = self .reg (op )
806806 src = self .reg (op .src )
807807 # TODO: support tuple type
808- assert isinstance (op .src_type , RStruct )
808+ assert isinstance (op .src_type , RStruct ), op . src_type
809809 assert op .field in op .src_type .names , "Invalid field name."
810810 self .emit_line (
811811 "{} = ({})&(({} *){})->{};" .format (
0 commit comments