Implement raise from type checking

Fix #337 
Thank you for the suggestion. I have now removed the duplicate code into a new function and removed `skip_check_subtype` also. It looks better.