-
Notifications
You must be signed in to change notification settings - Fork 148
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
breaks compile by removing non-redundant imports #445
Comments
This took at least a day to debug - as we were accidentally reformatting code in elm-stuff and getting the terrible error message:
Would work on some people's computers and not on others depending on how they'd setup their elm-format (version, directory). Would suggest an invariant for elm-format is - code compiles -> reformat -> code compiles. |
@newmana for reference, can you give the imports your project had that were being collapsed? |
See this pull request (you might have missed that linked above): Run 0.7.0-exp on: Specifically on that file: Becomes: Which means Html.Attributes.min/max no longer works. For example: https://github.com/abadi199/elm-input-extra/blob/1a4116812b0979c63bfbae9e18d960c80bc81bfb/src/Input/Number.elm#L157 |
(comment deleted, I instead commented on #379) |
Adapt the expectations in automated tests, considering that some modules import the same module using different aliases. The previous version was closer to behavior as observed with elm-format. However, looking closer at imports, the current version of elm-format seems to be not always compatible with Elm, sometimes breaking compiling code. For discussion of the issues around import statements, see: avh4/elm-format#379 (comment) avh4/elm-format#445 avh4/elm-format#577
Adapt the expectations in automated tests, considering that some modules import the same module using different aliases. The previous version was closer to behavior as observed with elm-format. However, looking closer at imports, the current version of elm-format seems to be not always compatible with Elm, sometimes breaking compiling code. For discussion of the issues around import statements, see: avh4/elm-format#379 (comment) avh4/elm-format#445 avh4/elm-format#577
I have imports
and access most attributes as
Svg.<attribute>
. But bothSvg
andSvg.Attributes
definestyle
, so I need the third import to be able to accessSvg.Attributes.Style
explicitly.elm-format
however removes that import statement, converting compiling elm code to non-compiling elm-code.(Yes, that import situation is a bit messy; it seems that the real
Svg.style
isn't accessible at all anymore.)The text was updated successfully, but these errors were encountered: