stc icon indicating copy to clipboard operation
stc copied to clipboard

fix(ts/analyzer): Update normalize intersection condition about return never

Open sunrabbit123 opened this issue 2 years ago • 1 comments

Description:

        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 {
            return never!();
        }

        if u32::from(is_str) + u32::from(is_enum_variant) + u32::from(is_bool) >= 2 {
            return never!();
        }

number & SomeEnum is possible, but string & SomeEnum is impossible


Closes https://github.com/dudykr/stc/issues/174

sunrabbit123 avatar Nov 08 '22 07:11 sunrabbit123

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 08 '22 07:11 CLAassistant

but increase 2 extra_error; I'll be back after I fix it

and

made returnable errors.. ㅠㅠ

sunrabbit123 avatar Dec 05 '22 03:12 sunrabbit123

I think another PR would be also fine, if you prefer it

kdy1 avatar Dec 05 '22 04:12 kdy1

I'm happy. Because it's all over now.

sunrabbit123 avatar Dec 05 '22 05:12 sunrabbit123

Great, thank you!

kdy1 avatar Dec 05 '22 05:12 kdy1