elm/compiler

5 SSCCEs for Map.! error

jinjor opened this issue · 2 comments

I created 5 SSCCEs for Map.! error.
Most of them are already reported, but I was able to make them much shorter.

  1. Array
-- Always fails
main : Program () () (Array ())
main =
    Debug.todo ""
  1. Html
-- Fails if elm/virtual-dom is in "indirect"
main : Program () () (Html ()) -- or Attribute
main =
    Debug.todo ""
  1. Svg
-- Fails if elm/virtual-dom is in "indirect"
main : Program () () (Svg ())  -- or Attribute
main =
    Debug.todo ""
  1. Plot from Bractlet/elm-plot (#1852)
-- Bractlet/elm-plot
-- Point is an alias of a type in non-exposed Module
import Plot exposing (Point)

type Msg
    = Msg Point

-- Fails
main : Program () () Msg
main =
    Debug.todo ""
-- Succeeds
main : Program () () Point
main =
    Debug.todo ""
  1. Part from jinjor/elm-req
-- jinjor/elm-req
-- Part contains File and Bytes
import Req exposing (Part)

-- Fails if elm/file or elm/bytes is in "indirect"
main : Program () () Part
main =
    Debug.todo ""

From those examples, it should be true that Msg cannot be / contain a type from non-exposed module.

Details can be seen here.
https://github.com/jinjor/elm-map-sscce

Thank you for organizing this!

I just went through with the development build of the compiler, and all of the files in src/ directories compile successfully now. Some additional details on the fix are available here: #1850 (comment)

Thanks again for getting the examples down so small and making it really easy to test them!