Repository navigation
ensure external signatures do not enforce type checking - #6567
merelymyself wants to merge 1 commit into
Conversation
|
I don't think completely bypassing parser errors like that is a good idea because it defeats the purpose of having custom signatures for externals and also ignores other errors unrelated to completions that might happen during the parsing. I think a better solution would be to have "fall-through" signatures: Instead of defining the signature strictly, make it so that it would "assist" the signature. It would type-check the parameters you specify in the signature, but if you pass something else, it would be collected in a separate variable and wouldn't throw an error. We can chat on Discord and try to come up with some design but this PR feels more like a hack, I'd rather not merge it. Thanks for the effort, though. The summary of the affected issues is also useful, it's something we should definitely address. |
|
@kubouch, I see your point. Do you think a configuration option where all three systems, the current one, this new one in the PR, and the "fall-through" are implemented? Btw, could you also explain what you mean by "fall-through signature"? I don't quite get it 😬 Thanks! |
|
@kubouch , any update on this? |
|
Ah, sorry, check my latest message in the #completions channel on Discord, that explains it a bit. By "fall-through" signatures I mean you could type |
|
maybe I’ll give a shot at drop-through parameters, or maybe a config option that allows users the configure their preference, or maybe both |
Description
Title. Fixes #4659. Fixes #6020. Kind of Fixes #5103. Fixes #5294. Fixes #6124. Try typing
git fetch -a; I have no clue how to add tests for this.This prevents all parse errors for export extern; in other words, now the exported extern is only used for completions.
Related to the discussion in #6020, I'm wondering if the hard check should be a configurable option, turned off by default. Thoughts?
Tests
Make sure you've done the following:
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspace --features=extrato check that all the tests pass