witchcrafters / witchcraft

Monads and other dark magic for Elixir
https://witchcrafters.github.io
MIT License
1.2k stars 58 forks source link

elixir 1.12 : then/2 conflicts with Kernel.then/2 #90

Closed asmodehn closed 3 years ago

asmodehn commented 3 years ago

With elixir 1.12 : Apply.then/2 conflicts with Kernel.then/2 in a few places during compilation :

== Compilation error in file lib/witchcraft/foldable.ex ==
** (CompileError) lib/witchcraft/foldable.ex:751: function then/2 imported from both Witchcraft.Apply and Kernel, call is ambiguous
    (elixir 1.12.3) src/elixir_dispatch.erl:42: :elixir_dispatch.import_function/4
    (elixir 1.12.3) src/elixir_fn.erl:76: :elixir_fn.capture_import/4
    (stdlib 3.16.1) lists.erl:1358: :lists.mapfoldl/3
    (stdlib 3.16.1) lists.erl:1359: :lists.mapfoldl/3
== Compilation error in file test/witchcraft_test.exs ==
** (CompileError) (for doctest at) lib/witchcraft/apply.ex:382: function then/2 imported from both Witchcraft.Apply and Kernel, call is ambiguous
    (elixir 1.12.3) expanding macro: Kernel.|>/2
    (for doctest at) lib/witchcraft/apply.ex:382: WitchcraftTest."doctest Witchcraft.Apply.then/2 (36)"/1
    (elixir 1.12.3) lib/kernel/parallel_compiler.ex:428: Kernel.ParallelCompiler.require_file/2
    (elixir 1.12.3) lib/kernel/parallel_compiler.ex:321: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

I am not sure what should be the proper fix, I'll try something quick...

github-actions[bot] commented 3 years ago

Thank you for submitting an issue! It means a lot that you took the time -- it helps us be better 🙏

m-col commented 3 years ago

Looks like this was fixed already: https://github.com/witchcrafters/witchcraft/commit/70317fab7d00e383df54b48fd678fabd9fb1afd5

florius0 commented 3 years ago

Use witchcraft from github rather then from hex. https://hexdocs.pm/mix/1.12/Mix.Tasks.Deps.html

asmodehn commented 3 years ago

Thanks for the heads up. I verified that the version from master works for me. Closing this.

QuinnWilton commented 2 years ago

These fixes have now been published as version 1.0.4; thank you for your patience! https://github.com/witchcrafters/witchcraft/issues/106