-
Notifications
You must be signed in to change notification settings - Fork 26
Add a more convenient API for calling aqua functions programmatically #233
Conversation
packages/fluence-js/src/internal/compilerSupport/v3impl/callFunction.ts
Outdated
Show resolved
Hide resolved
packages/fluence-js/src/internal/compilerSupport/v3impl/callFunction.ts
Outdated
Show resolved
Hide resolved
|
|
||
| const getArgumentTypes = (def: FunctionCallDef) => { | ||
| if (def.arrow.domain.tag !== 'labeledProduct') { | ||
| throw new Error('Should be impossible'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
closes DXJ-198