Pattern matching in kotlin's when construction