on master help sign in
Merge branch 'master' into typo_fix
commit30321eb9afcd83912ec86a21a4a95cb53bcfe8d3 authorBen Ansell <code@benansell.com> dateWed 26 Oct 2016, 10:50 (10 years ago) parent4586dfea7d538b
2 files changed+11−14
src/Elm/Compiler/Type/Extract.hs+10−13 src/Reporting/Error/Canonicalize.hs+1−1
src/Elm/Compiler/Type/Extract.hs+10−13
@@ -73,19 +73,16 @@ extractProgram :: Module.Interfaces -> ModuleName.Canonical -> Maybe Program
7373extractProgram interfaces name =
7474 do iface <- Map.lookup name interfaces
7575 mainType <- Map.lookup "main" (Module.iTypes iface)
76− case mainType of
77− T.App _program [_flags, _model, msg] ->
78− let
79− (msgType, msgDeps) =
80− Writer.runWriter (extractHelp msg)
81−
82− (aliases, unions) =
83− extractTransitive interfaces mempty msgDeps
84− in
85− Just $ Program msgType aliases unions
86−
87− _ ->
88− Nothing
76+
77+ message <-
78+ case T.deepDealias mainType of
79+ T.App _program [_flags, _model, msg] -> Just msg
80+ T.App _node [msg] -> Just msg
81+ _ -> Nothing
82+
83+ let (msgType, msgDeps) = Writer.runWriter (extractHelp message)
84+ let (aliases, unions) = extractTransitive interfaces mempty msgDeps
85+ Just $ Program msgType aliases unions
8986
9087
9188type Alias =
src/Reporting/Error/Canonicalize.hs+1−1
@@ -350,7 +350,7 @@ badSelfRecursion :: Region.Region -> String -> Report.Report
350350badSelfRecursion region name =
351351 let
352352 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."
354354 in
355355 Report.report "BAD RECURSION" (Just region) header $
356356 Help.stack