@@ -16,8 +16,10 @@ import qualified AST.Canonical as Can
1616import qualified Elm.Name as N
1717import qualified Reporting.Annotation as A
1818import qualified Reporting.Error.Type as Error
19+import qualified Reporting.Render.Type as RT
1920import qualified Type.Occurs as Occurs
2021import Type.Type as Type
22+import qualified Type.Error as ET
2123import qualified Type.Unify as Unify
2224import qualified Type.UnionFind as UF
2325
@@ -211,10 +213,13 @@ isGeneric var =
211213 if rank == noRank
212214 then return ()
213215 else
214− error
215− "You ran into a compiler bug!\n\n\
216− \I was unable to generalize a type variable during type inference. It was ranked.\n\n\
217− \Please create an <http://sscce.org/> and report it at <https://github.com/elm-lang/elm-compiler/issues>\n\n"
216+ do tipe <- Type.toErrorType var
217+ error $
218+ "You ran into a compiler bug. Here are some details for the developers:\n\n"
219+ ++ " " ++ show (ET.toDoc Map.empty RT.None tipe) ++ " [rank = " ++ show rank ++ "]\n\n"
220+ ++
221+ "Please create an <http://sscce.org/> and then report it\n\
222+ \at <https://github.com/elm-lang/elm-compiler/issues>\n\n"
218223
219224
220225