struggling to implement self call typechecking