-
Notifications
You must be signed in to change notification settings - Fork 20
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
Dead Types wrt consumed types #169
Comments
How does the Axis post get access to it? Is |
Great! |
@send
external postImpl: (
axios,
string,
'data,
config,
) => Js.Promise.t<response<'datasend, 'datarecv, 'headersrecv, 'request>> = "post"
let post = (url, data, config) => axios->postImpl(url, data, config)
type argsClone<'id> = {
name: string,
description: string,
with_data: bool,
clone_id: 'id,
}
type clone = {id: int}
let clone = (data: argsClone<int>): Js.Promise.t<
Axios.response<'datasend, cloneCapability, 'headers, 'request>,
> => {
Axios.post(`/api/capability/`, data, configJson)
} |
Currently there's no magic that tries to understand flow of values to externals. In these cases, it's best to annotate the type |
E.g. @live("sent to Axios")
type argsClone<'id> = {
name: string,
description: string,
with_data: bool,
clone_id: 'id,
} |
The other thing is just because a value is sent to an external, that does not mean that the external function. is going to read all its fields, so any automatic analysis would be pretty coarse. |
That seems pretty reasonable to me. False positives and aggressive annotations are a burden adding just for context that -dce produces 8500 lines of output for our codebase, so basically too much for our small team (anyways thanks again!) |
Hi again Cristiano.
Just added dce to our CI process and going through the output i get:
argsClone is consumed by an external Axios.post, and this type is a preposition for our
clone
action, so these warnings seem like false positive to me. Its not wrong, granted, but suggests I can remove that field which is wrong.Are you doing any work in this direction?
Thanks!
Alex
The text was updated successfully, but these errors were encountered: