Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Conversation

@coder11
Copy link
Contributor

@coder11 coder11 commented Dec 22, 2022

closes DXJ-198


const getArgumentTypes = (def: FunctionCallDef) => {
if (def.arrow.domain.tag !== 'labeledProduct') {
throw new Error('Should be impossible');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it should be impossible - maybe no need for this chek? Or if you think that it is possible - maybe a better error message for the user so he knows what he can do if this situation accures

Copy link
Contributor Author

@coder11 coder11 Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I don't check the TS compiler will complain about the missing match case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now. I understand that if this happens - compiler output is wrong right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the compiler output would be wrong.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe would be still not that bad to say it in error message

Copy link
Contributor

@shamsartem shamsartem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments with minor suggestions. Thanks.

@coder11 coder11 requested a review from shamsartem December 22, 2022 16:42
Copy link
Contributor

@shamsartem shamsartem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@linear
Copy link

linear bot commented Dec 27, 2022

@coder11 coder11 merged commit dcb15b7 into master Dec 27, 2022
@coder11 coder11 deleted the new-compiler-support branch December 27, 2022 13:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants