Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable/warn opt rule for textual parser #214

Closed
chenyan-dfinity opened this issue Apr 1, 2021 · 1 comment · Fixed by #211
Closed

Disable/warn opt rule for textual parser #214

chenyan-dfinity opened this issue Apr 1, 2021 · 1 comment · Fixed by #211
Labels
enhancement New feature or request

Comments

@chenyan-dfinity
Copy link
Contributor

when dfx call takes an opt type, the opt subtyping rule essentially turns off the type checking. We need to disable or at least warn about the use of opt subtyping rules in the parser.

@chenyan-dfinity chenyan-dfinity added the enhancement New feature or request label Apr 1, 2021
@nomeata
Copy link
Collaborator

nomeata commented Apr 1, 2021

I wonder how useful it is in general to apply subtyping here. Subtyping is meant to be used when A sends a message to B according to an old B.did, so really only should play a role during decoding a message from another party.

When A is a CLI interface that parses a textual argument according to A’s believe of B’s interface, we don’t need to apply full subtyping, we merely need to use B.did to help resolve overloading, and maybe for convenience stuff (e.g. omitting optional arguments).

I don’t see a point in ignoring additional record fields, doing the full opt-field handling etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants