elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.51k stars 656 forks source link

"Map.!: given key is not an element in the map" with mutual recursion and exposed functions #2207

Open joakin opened 3 years ago

joakin commented 3 years ago

Quick Summary: Trying to get the type of a mutually recursive function crashes the compiler

SSCCE

module Test exposing (..)

f x =
    g x

g x =
    f x

And then in the Repl:

→ elm repl
---- Elm 0.19.1 ----------------------------------------------------------------
Say :help for help and :exit to exit! More at <https://elm-lang.org/0.19.1/repl>
--------------------------------------------------------------------------------
> import Test
> Test.f
<function> : a -> b
> Test.g
elm: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
  error, called at libraries/containers/Data/Map/Internal.hs:610:17 in containers-0.5.11.0:Data.Map.Internal
github-actions[bot] commented 3 years ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.