pattern matching added to kotlin's when construction