git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Improve deprecated syntax warning messages
commit0e0c37b9cb65cb00b9d7d19653b68277dcce07ef authorGary Burgess <gary.burgess@gmail.com> dateSat 5 Dec 2015, 21:47 (11 years ago) parent0d88ee2
1 file changed+18−6
src/Language/PureScript/Errors.hs+18−6
src/Language/PureScript/Errors.hs+18−6
@@ -774,16 +774,28 @@ prettyPrintSingleError full level e = do
774774 , indent $ paras $ map (line .runProperName) names ]
775775
776776 renderSimpleErrorMessage (DeprecatedQualifiedSyntax name qualName) =
777− paras [ line $ "The import of type " ++ runModuleName name ++ " as " ++ runModuleName qualName ++ " uses the deprecated 'import qualified' syntax."
778− , line $ "This syntax form will be removed in PureScript 0.9." ]
777+ paras [ line $ "Import uses the deprecated 'qualified' syntax:"
778+ , indent $ line $ "import qualified " ++ runModuleName name ++ " as " ++ runModuleName qualName
779+ , line "Should instead use the form:"
780+ , indent $ line $ "import " ++ runModuleName name ++ " as " ++ runModuleName qualName
781+ , line $ "The deprecated syntax will be removed in PureScript 0.9."
782+ ]
779783
780784 renderSimpleErrorMessage (DeprecatedClassImport mn name) =
781− paras [ line $ "The import of class " ++ runProperName name ++ " from " ++ runModuleName mn ++ " uses the deprecated syntax that omits the class keyword."
782− , line $ "This syntax form will be removed in PureScript 0.9." ]
785+ paras [ line $ "Class import from " ++ runModuleName mn ++ " uses deprecated syntax that omits the 'class' keyword:"
786+ , indent $ line $ runProperName name
787+ , line "Should instead use the form:"
788+ , indent $ line $ "class " ++ runProperName name
789+ , line $ "The deprecated syntax will be removed in PureScript 0.9."
790+ ]
783791
784792 renderSimpleErrorMessage (DeprecatedClassExport name) =
785− paras [ line $ "The export of class " ++ runProperName name ++ " uses the deprecated syntax that omits the class keyword."
786− , line $ "This syntax form will be removed in PureScript 0.9." ]
793+ paras [ line $ "Class export uses deprecated syntax that omits the 'class' keyword:"
794+ , indent $ line $ runProperName name
795+ , line "Should instead use the form:"
796+ , indent $ line $ "class " ++ runProperName name
797+ , line $ "The deprecated syntax will be removed in PureScript 0.9."
798+ ]
787799
788800 renderSimpleErrorMessage (RedundantUnqualifiedImport name imp) =
789801 line $ "Import of " ++ prettyPrintImport name imp Nothing ++ " is redundant due to a whole-module import"