kaleidawave / ezno

A JavaScript compiler and TypeScript checker written in Rust with a focus on static analysis and runtime performance
https://kaleidawave.github.io/posts/introducing-ezno/
MIT License
2.3k stars 42 forks source link

Check catch argument type annotation #131

Closed CharlesTaylor7 closed 2 months ago

CharlesTaylor7 commented 2 months ago

Part 1 of implementing #112

Just handles invalid catch annotations. I'll do a separate PR for checking default function arguments.

kaleidawave commented 2 months ago

Thanks for taking this on! Looking forward to default parameter value check as well!

I think you might have missed using the new diagnostic though 😅

https://github.com/kaleidawave/ezno/pull/131/files#diff-0d883820650b8c390ce4cec20ce7c37e02118eb23085c447d0452c29f1b8229cR328

Also could the error message be Cannot catch type {found} because the try block throws {expected}?

Otherwise perfect & ready to merge 😍

test result: ok. 201 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.11s
CharlesTaylor7 commented 2 months ago

@kaleidawave Done and done.

This is an awesome project, by the way, really hope it takes off. Thanks for the quick feedback!