type check -> pattern matching