finos / morphir-elm

Tools to work with the Morphir IR in Elm.
https://package.elm-lang.org/packages/finos/morphir-elm/latest
Apache License 2.0
45 stars 63 forks source link

Compiler gives no warning for redundant definitions, and obscures errors in earlier definitions #1101

Open edwardpeters opened 1 year ago

edwardpeters commented 1 year ago

Describe the bug If two definitions by the same name are given in the same module, the compiler gives no errors or warnings; additionally, any errors in the earlier definition are not shown.

To Reproduce Compile the following file:

module Scratch.ExampleModule exposing (..)

typeErrorTest : Bool -> String
typeErrorTest x = True

typeErrorTest : Bool -> Bool
typeErrorTest x = x

With both make and make -f, this successfully compiles with no warnings given.

Expected behavior An error should be given for the conflicting definitions, and errors from example functions should not be hidden.

Desktop (please complete the following information):

Additional context This has a negative impact on developer experience, as we get very confusing behavior where a function appears to be compiling but neither its errors nor runtime behavior are actually apparent.