The Elm.Annotation.dict function does not, on its own, cause Dict to get imported. I saw this when adding a feature to elm-open-api-cli (permalink that requires clicking 'Load diff' on SchemaUtils.elm).
This rears its head when nothing else in the File calls a Dict function, which is exactly the case when elm-open-api-cli generates an OpenAPI schema's Types.elm module.
SSCCE repository is here, but here's the code that generates a bad module, for reference:
import Elm.Annotation as Type
fileMissingImport : Elm.File
fileMissingImport =
Elm.file [ "MissingImport" ]
[ Elm.alias "SomeDict" (Type.dict Type.string Type.int)
]
The code it generates:
module MissingImport exposing (..)
type alias SomeDict =
Dict.Dict String Int
The
Elm.Annotation.dictfunction does not, on its own, causeDictto get imported. I saw this when adding a feature toelm-open-api-cli(permalink that requires clicking 'Load diff' on SchemaUtils.elm).This rears its head when nothing else in the
Filecalls aDictfunction, which is exactly the case whenelm-open-api-cligenerates an OpenAPI schema'sTypes.elmmodule.SSCCE repository is here, but here's the code that generates a bad module, for reference:
The code it generates: