halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Other imports are changed inappropriate after 'add import' #41

Closed stil4m closed 7 years ago

stil4m commented 7 years ago

Suppose you have one type Vehicle with a value constructor Car in the module Vehicle, and a type alias Car (for a record) in the module Car. When using both Vehicle and Car in a third module and adding an import to that third module using Elmjutsu, the import for the Car module is changed inappropriate into a compilation error.

I've created a repository to simulate this bug.

It seems that Elmjutsu infers the type alias as the value constructor and changes

import Car exposing (Car)

into

import Car exposing (Vehicle(Car))