on master help sign in
Merge branch 'master' into typo_fix
30321ebBen Ansell
src/Elm/Compiler/Type/Extract.hs+10−13
@@ -73,19 +73,16 @@ extractProgram :: Module.Interfaces -> ModuleName.Canonical -> Maybe Program
73extractProgram interfaces name =
73extractProgram interfaces name =
74 do iface <- Map.lookup name interfaces
74 do iface <- Map.lookup name interfaces
75 mainType <- Map.lookup "main" (Module.iTypes iface)
75 mainType <- Map.lookup "main" (Module.iTypes iface)
76+
77+ message <-
76− case mainType of
78+ case T.deepDealias mainType of
77− T.App _program [_flags, _model, msg] ->
79+ T.App _program [_flags, _model, msg] -> Just msg
78− let
80+ T.App _node [msg] -> Just msg
79− (msgType, msgDeps) =
81+ _ -> Nothing
82+
80− Writer.runWriter (extractHelp msg)
83+ let (msgType, msgDeps) = Writer.runWriter (extractHelp message)
81−
82− (aliases, unions) =
83− extractTransitive interfaces mempty msgDeps
84+ let (aliases, unions) = extractTransitive interfaces mempty msgDeps
84− in
85− Just $ Program msgType aliases unions
85+ Just $ Program msgType aliases unions
86−
87− _ ->
88− Nothing
89
86
90
87
91type Alias =
88type Alias =
src/Reporting/Error/Canonicalize.hs+1−1
@@ -350,7 +350,7 @@ badSelfRecursion :: Region.Region -> String -> Report.Report
350badSelfRecursion region name =
350badSelfRecursion region name =
351 let
351 let
352 header =
352 header =
353− Help.functionName name ++ " is defined diretly in terms of itself, causing an infinite loop."
353+ Help.functionName name ++ " is defined directly in terms of itself, causing an infinite loop."
354 in
354 in
355 Report.report "BAD RECURSION" (Just region) header $
355 Report.report "BAD RECURSION" (Just region) header $
356 Help.stack
356 Help.stack