gregziegan / elm-autocomplete

Autocomplete for Elm apps; in Elm
http://package.elm-lang.org/packages/thebritican/elm-autocomplete/latest
BSD 3-Clause "New" or "Revised" License
173 stars 43 forks source link

Used with multiple declarations Autocomplete breaks the Elm compiler and gives runtime errors #29

Closed edmellum closed 8 years ago

edmellum commented 8 years ago

I don't know if this belongs in elm-compiler or here. As I couldn't reproduce it without Autocomplete I decided this is where it should go first. To me the problem does however seem to be the compiler doing something it shouldn't.

Using this example the ordering of the compiled Javascript in the let declaration in update becomes incorrect and causes val to become undefined. If one attempts to use val for anything a runtime exception is raised. I haven't been able to produce a reproduction without elm-autocomplete by just attempting to do the same things it does. Somehow it's causing the Elm compiler to mess up the order in let blocks.

pdamoc commented 8 years ago

Switching lines 22 and 23 from the gist ends up in a thrown runtime error.

edmellum commented 8 years ago

Closing this and opening an issue in elm-compiler as I've created a case without autocomplete.