Skip to content

Duplicate aliases cause infinite recursion #95

@s3cur3

Description

@s3cur3

Hi there! Thanks for a wonderfully useful tool. ☺️

While introducing Recode to a moderately large codebase, I found mix format would never terminate. When I added some debugging output, the Recode.Task.AliasOrder task seemed to be getting stuck on a handful of files, some of which were tests and others actual production code. After squinting at it for awhile, it looked like the common surprising feature between all of them was the presence of duplicate alias lines, like:

defmodule MyApp.MyModule do
  alias MyApp.Foo
  alias MyApp.Bar
  alias MyApp.Bar
  alias MyApp.Baz
end

Note that I did not have any issues running mix recode over the same files.

I'm not sure that the above is a sufficient minimal reproduction case, but I'll see if I can submit a patch in the next few days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions