FondationSTaBLFoundation / MOR2Issues

0 stars 0 forks source link

Ambiguous Compilation Code Prevents use Of Certain Imports #5

Open rsninja722 opened 2 years ago

rsninja722 commented 2 years ago

When the run button is pressed, WebIDE tacks on some code to the end of your existing code before compiling.

the functions used in this code do not specify the package they come from which can cause errors the user cannot fix like this:

-- AMBIGUOUS NAME ------------------------------ Nickolij/InterestVisualizer.elm

This usage of `text` is ambiguous:

296 |             , text ("(" ++ String.fromFloat time ++ ", " ++ String.fromFloat (toFloat (round <| (f time) * 100) / 100)  ++ ")")
                   ^^^^
This name is exposed by 2 of your imports, so I am not sure which one to use:

    GraphicSVG.text
    Html.text

I recommend using qualified names for imported values. I also recommend having
at most one `exposing (..)` per file to make name clashes like this less common
in the long run.

Note: Check out  for more info on the
import syntax.

Note: there are only 268 lines in the program this example is from.

In order to prevent unfixable errors, the package for everything in the appended compilation code shouldn't be ambiguous.

christopheranand commented 2 years ago

For anyone that runs into this problem. You can always use qualifications, and the compiler tells you which ones are available. Replace text by one of GraphicSVG.text or Html.text.

In the future we will make a new Activity in which you can control what is exposed.