emit IR for typed expression
more test cases mainly for statements
tiny fixes and a cosmetic change

- remove unused variable
- add `[[noreturn]]` to avoid warning on build