stc
stc copied to clipboard
Speedy TypeScript type checker
**Description:** ```rs let is_str = types.iter().any(|ty| ty.is_str()); let is_num = types.iter().any(|ty| ty.is_num()); let is_bool = types.iter().any(|ty| ty.is_bool()); let is_enum_variant = types.iter().any(|ty| ty.is_enum_variant()); if u32::from(is_str) + u32::from(is_num) + u32::from(is_bool) >= 2...
https://github.com/dudykr/stc/blob/798c322abf94b8353feb4f4022185b932069f5e1/crates/stc_ts_type_checker/tests/conformance/es6/spread/iteratorSpreadInCall2.ts#L1-L16 should pass, but `stc` fails with ``` thread 'conformance::es6::spread::iteratorSpreadInCall2.ts' panicked at ' ============================================================ error[TS2345]: DebugContext( context: arg is spread context: lhs = instanceof symbol[]; rhs = symbol; context: `fail!()`...
I configured CI in https://github.com/dudykr/stc/pull/274, but I found that it fails with OOM even without LTO. So we should use a powerful runner. Hopefully, some people donated so we can...
I added the error code normalization to focus on making type inference correct, but we should remove it in the future for 100% parity
**Description:** Returns the correct TS error code for spread parameter. Please let me know if this is the right approach. I'm new to both Rust and this project. Thanks! **Related...
We can use per-module top-level syntax context to make all identifiers distinguishable
## Test cases to split https://gist.github.com/kdy1/8198130f16e42514b22656c57690b124
https://github.com/dudykr/stc/blob/08b4941e01e39aee21d0544061e16e60a8ce02f8/crates/stc_ts_type_checker/tests/conformance/types/rest/objectRestPropertyMustBeLast.ts#L1-L5 This should fail with errors for non-last rest patterns, but currently, it fails with ``` thread 'conformance::types::rest::objectRestPropertyMustBeLast.ts' panicked at ' ============================================================ TS2403 x context: tried to validate a varaible...
https://github.com/dudykr/stc/blob/08b4941e01e39aee21d0544061e16e60a8ce02f8/crates/stc_ts_type_checker/tests/conformance/internalModules/moduleDeclarations/nestedModules.ts#L1-L12 This is currently not supported by stc, but it's required for 100% parity.