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

Is the SpecWithStruct warning still relevant with new elixir static type checking? #107

Open
flaviogrossi opened this issue Dec 16, 2024 · 1 comment

Comments

@flaviogrossi
Copy link

What do you want Credo to do?

Currently credo emits a warning if a struct is used in a spec. The rationale is that a struct would create a dependency.

Is this still the case with newer elixir versions now that the compiler checks struct types at compile time causing the dependency anyway? Intuitively i think the structure must be loaded anyway to perform the new static type checking.

Is this warning still relevant? Should it be disabled now?

Which existing behaviour would change?

If the premise is correct, the warning should probably be disabled by default

@rrrene
Copy link
Owner

rrrene commented Dec 17, 2024

Hi Flavio,

I am no expert in Dialyzer and can not answer the question. Hopefully, someone from the community can chime in.

Since this check is an opt-in check about how to structure @spec attributes, I could imagine that it holds value even if your premise turns out to be true.

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

No branches or pull requests

2 participants