@@ -75,6 +75,14 @@ data SimpleErrorMessage
7575 | UnknownValue (Qualified Ident)
7676 | UnknownDataConstructor (Qualified ProperName) (Maybe (Qualified ProperName))
7777 | UnknownTypeConstructor (Qualified ProperName)
78+ | UnknownImportType ModuleName ProperName
79+ | UnknownExportType ProperName
80+ | UnknownImportTypeClass ModuleName ProperName
81+ | UnknownExportTypeClass ProperName
82+ | UnknownImportValue ModuleName Ident
83+ | UnknownExportValue Ident
84+ | UnknownImportDataConstructor ModuleName ProperName ProperName
85+ | UnknownExportDataConstructor ProperName ProperName
7886 | ConflictingImport String ModuleName
7987 | ConflictingImports String ModuleName ModuleName
8088 | ConflictingTypeDecls ProperName
@@ -164,82 +172,90 @@ instance UnificationError Kind ErrorMessage where
164172--
165173errorCode :: ErrorMessage -> String
166174errorCode em = case unwrapErrorMessage em of
167− (ErrorParsingExterns _) -> "ErrorParsingExterns"
168− (ErrorParsingFFIModule _) -> "ErrorParsingFFIModule"
169− (ErrorParsingModule _) -> "ErrorParsingModule"
170− MissingFFIModule{} -> "MissingFFIModule"
171− MultipleFFIModules{} -> "MultipleFFIModules"
172− UnnecessaryFFIModule{} -> "UnnecessaryFFIModule"
173− (InvalidExternsFile _) -> "InvalidExternsFile"
174− (CannotGetFileInfo _) -> "CannotGetFileInfo"
175− (CannotReadFile _) -> "CannotReadFile"
176− (CannotWriteFile _) -> "CannotWriteFile"
177− (InfiniteType _) -> "InfiniteType"
178− (InfiniteKind _) -> "InfiniteKind"
179− CannotReorderOperators -> "CannotReorderOperators"
180− (MultipleFixities _) -> "MultipleFixities"
181− (OrphanTypeDeclaration _) -> "OrphanTypeDeclaration"
182− (OrphanFixityDeclaration _) -> "OrphanFixityDeclaration"
183− (RedefinedModule _ _) -> "RedefinedModule"
184− (RedefinedIdent _) -> "RedefinedIdent"
185− OverlappingNamesInLet -> "OverlappingNamesInLet"
186− (UnknownModule _) -> "UnknownModule"
187− (UnknownType _) -> "UnknownType"
188− (UnknownTypeClass _) -> "UnknownTypeClass"
189− (UnknownValue _) -> "UnknownValue"
190− (UnknownDataConstructor _ _) -> "UnknownDataConstructor"
191− (UnknownTypeConstructor _) -> "UnknownTypeConstructor"
192− (ConflictingImport _ _) -> "ConflictingImport"
193− (ConflictingImports _ _ _) -> "ConflictingImports"
194− (ConflictingTypeDecls _) -> "ConflictingTypeDecls"
195− (ConflictingCtorDecls _) -> "ConflictingCtorDecls"
196− (TypeConflictsWithClass _) -> "TypeConflictsWithClass"
197− (CtorConflictsWithClass _) -> "CtorConflictsWithClass"
198− (ClassConflictsWithType _) -> "ClassConflictsWithType"
199− (ClassConflictsWithCtor _) -> "ClassConflictsWithCtor"
200− (DuplicateClassExport _) -> "DuplicateClassExport"
201− (DuplicateValueExport _) -> "DuplicateValueExport"
202− (DuplicateTypeArgument _) -> "DuplicateTypeArgument"
203− InvalidDoBind -> "InvalidDoBind"
204− InvalidDoLet -> "InvalidDoLet"
205− (CycleInDeclaration _) -> "CycleInDeclaration"
206− (CycleInTypeSynonym _) -> "CycleInTypeSynonym"
207− (CycleInModules _) -> "CycleInModules"
208− (NameIsUndefined _) -> "NameIsUndefined"
209− (NameNotInScope _) -> "NameNotInScope"
210− (UndefinedTypeVariable _) -> "UndefinedTypeVariable"
211− (PartiallyAppliedSynonym _) -> "PartiallyAppliedSynonym"
212− (EscapedSkolem _) -> "EscapedSkolem"
213− UnspecifiedSkolemScope -> "UnspecifiedSkolemScope"
214− (TypesDoNotUnify _ _) -> "TypesDoNotUnify"
215− (KindsDoNotUnify _ _) -> "KindsDoNotUnify"
216− (ConstrainedTypeUnified _ _) -> "ConstrainedTypeUnified"
217− (OverlappingInstances _ _ _) -> "OverlappingInstances"
218− (NoInstanceFound _ _) -> "NoInstanceFound"
219− (CannotDerive _ _) -> "CannotDerive"
220− (CannotFindDerivingType _) -> "CannotFindDerivingType"
221− (DuplicateLabel _ _) -> "DuplicateLabel"
222− (DuplicateValueDeclaration _) -> "DuplicateValueDeclaration"
223− (ArgListLengthsDiffer _) -> "ArgListLengthsDiffer"
224− (OverlappingArgNames _) -> "OverlappingArgNames"
225− (MissingClassMember _) -> "MissingClassMember"
226− (ExtraneousClassMember _) -> "ExtraneousClassMember"
227− (ExpectedType _) -> "ExpectedType"
228− (IncorrectConstructorArity _) -> "IncorrectConstructorArity"
229− SubsumptionCheckFailed -> "SubsumptionCheckFailed"
230− (ExprDoesNotHaveType _ _) -> "ExprDoesNotHaveType"
231− (PropertyIsMissing _ _) -> "PropertyIsMissing"
232− (CannotApplyFunction _ _) -> "CannotApplyFunction"
233− TypeSynonymInstance -> "TypeSynonymInstance"
234− (OrphanInstance _ _ _) -> "OrphanInstance"
235− InvalidNewtype -> "InvalidNewtype"
236− (InvalidInstanceHead _) -> "InvalidInstanceHead"
237− (TransitiveExportError _ _) -> "TransitiveExportError"
238− (ShadowedName _) -> "ShadowedName"
239− (WildcardInferredType _) -> "WildcardInferredType"
240− (NotExhaustivePattern _ _) -> "NotExhaustivePattern"
241− (OverlappingPattern _ _) -> "OverlappingPattern"
242− (ClassOperator _ _) -> "ClassOperator"
175+ ErrorParsingExterns{} -> "ErrorParsingExterns"
176+ ErrorParsingFFIModule{} -> "ErrorParsingFFIModule"
177+ ErrorParsingModule{} -> "ErrorParsingModule"
178+ MissingFFIModule{} -> "MissingFFIModule"
179+ MultipleFFIModules{} -> "MultipleFFIModules"
180+ UnnecessaryFFIModule{} -> "UnnecessaryFFIModule"
181+ InvalidExternsFile{} -> "InvalidExternsFile"
182+ CannotGetFileInfo{} -> "CannotGetFileInfo"
183+ CannotReadFile{} -> "CannotReadFile"
184+ CannotWriteFile{} -> "CannotWriteFile"
185+ InfiniteType{} -> "InfiniteType"
186+ InfiniteKind{} -> "InfiniteKind"
187+ CannotReorderOperators -> "CannotReorderOperators"
188+ MultipleFixities{} -> "MultipleFixities"
189+ OrphanTypeDeclaration{} -> "OrphanTypeDeclaration"
190+ OrphanFixityDeclaration{} -> "OrphanFixityDeclaration"
191+ RedefinedModule{} -> "RedefinedModule"
192+ RedefinedIdent{} -> "RedefinedIdent"
193+ OverlappingNamesInLet -> "OverlappingNamesInLet"
194+ UnknownModule{} -> "UnknownModule"
195+ UnknownType{} -> "UnknownType"
196+ UnknownTypeClass{} -> "UnknownTypeClass"
197+ UnknownValue{} -> "UnknownValue"
198+ UnknownDataConstructor{} -> "UnknownDataConstructor"
199+ UnknownTypeConstructor{} -> "UnknownTypeConstructor"
200+ UnknownImportType{} -> "UnknownImportType"
201+ UnknownExportType{} -> "UnknownExportType"
202+ UnknownImportTypeClass{} -> "UnknownImportTypeClass"
203+ UnknownExportTypeClass{} -> "UnknownExportTypeClass"
204+ UnknownImportValue{} -> "UnknownImportValue"
205+ UnknownExportValue{} -> "UnknownExportValue"
206+ UnknownImportDataConstructor{} -> "UnknownImportDataConstructor"
207+ UnknownExportDataConstructor{} -> "UnknownExportDataConstructor"
208+ ConflictingImport{} -> "ConflictingImport"
209+ ConflictingImports{} -> "ConflictingImports"
210+ ConflictingTypeDecls{} -> "ConflictingTypeDecls"
211+ ConflictingCtorDecls{} -> "ConflictingCtorDecls"
212+ TypeConflictsWithClass{} -> "TypeConflictsWithClass"
213+ CtorConflictsWithClass{} -> "CtorConflictsWithClass"
214+ ClassConflictsWithType{} -> "ClassConflictsWithType"
215+ ClassConflictsWithCtor{} -> "ClassConflictsWithCtor"
216+ DuplicateClassExport{} -> "DuplicateClassExport"
217+ DuplicateValueExport{} -> "DuplicateValueExport"
218+ DuplicateTypeArgument{} -> "DuplicateTypeArgument"
219+ InvalidDoBind -> "InvalidDoBind"
220+ InvalidDoLet -> "InvalidDoLet"
221+ CycleInDeclaration{} -> "CycleInDeclaration"
222+ CycleInTypeSynonym{} -> "CycleInTypeSynonym"
223+ CycleInModules{} -> "CycleInModules"
224+ NameIsUndefined{} -> "NameIsUndefined"
225+ NameNotInScope{} -> "NameNotInScope"
226+ UndefinedTypeVariable{} -> "UndefinedTypeVariable"
227+ PartiallyAppliedSynonym{} -> "PartiallyAppliedSynonym"
228+ EscapedSkolem{} -> "EscapedSkolem"
229+ UnspecifiedSkolemScope -> "UnspecifiedSkolemScope"
230+ TypesDoNotUnify{} -> "TypesDoNotUnify"
231+ KindsDoNotUnify{} -> "KindsDoNotUnify"
232+ ConstrainedTypeUnified{} -> "ConstrainedTypeUnified"
233+ OverlappingInstances{} -> "OverlappingInstances"
234+ NoInstanceFound{} -> "NoInstanceFound"
235+ CannotDerive{} -> "CannotDerive"
236+ CannotFindDerivingType{} -> "CannotFindDerivingType"
237+ DuplicateLabel{} -> "DuplicateLabel"
238+ DuplicateValueDeclaration{} -> "DuplicateValueDeclaration"
239+ ArgListLengthsDiffer{} -> "ArgListLengthsDiffer"
240+ OverlappingArgNames{} -> "OverlappingArgNames"
241+ MissingClassMember{} -> "MissingClassMember"
242+ ExtraneousClassMember{} -> "ExtraneousClassMember"
243+ ExpectedType{} -> "ExpectedType"
244+ IncorrectConstructorArity{} -> "IncorrectConstructorArity"
245+ SubsumptionCheckFailed -> "SubsumptionCheckFailed"
246+ ExprDoesNotHaveType{} -> "ExprDoesNotHaveType"
247+ PropertyIsMissing{} -> "PropertyIsMissing"
248+ CannotApplyFunction{} -> "CannotApplyFunction"
249+ TypeSynonymInstance -> "TypeSynonymInstance"
250+ OrphanInstance{} -> "OrphanInstance"
251+ InvalidNewtype -> "InvalidNewtype"
252+ InvalidInstanceHead{} -> "InvalidInstanceHead"
253+ TransitiveExportError{} -> "TransitiveExportError"
254+ ShadowedName{} -> "ShadowedName"
255+ WildcardInferredType{} -> "WildcardInferredType"
256+ NotExhaustivePattern{} -> "NotExhaustivePattern"
257+ OverlappingPattern{} -> "OverlappingPattern"
258+ ClassOperator{} -> "ClassOperator"
243259
244260-- |
245261-- A stack trace for an error
@@ -451,6 +467,22 @@ prettyPrintSingleError full level e = prettyPrintErrorMessage <$> onTypesInError
451467 line $ "Unknown type constructor " ++ show name
452468 goSimple (UnknownDataConstructor dc tc) =
453469 line $ "Unknown data constructor " ++ show dc ++ foldMap ((" for type constructor " ++) . show) tc
470+ goSimple (UnknownImportType mn name) =
471+ line $ "Module " ++ show mn ++ " does not export type " ++ show name
472+ goSimple (UnknownExportType name) =
473+ line $ "Cannot export unknown type " ++ show name
474+ goSimple (UnknownImportTypeClass mn name) =
475+ line $ "Module " ++ show mn ++ " does not export type class " ++ show name
476+ goSimple (UnknownExportTypeClass name) =
477+ line $ "Cannot export unknown type class " ++ show name
478+ goSimple (UnknownImportValue mn name) =
479+ line $ "Module " ++ show mn ++ " does not export value " ++ show name
480+ goSimple (UnknownExportValue name) =
481+ line $ "Cannot export unknown value " ++ show name
482+ goSimple (UnknownImportDataConstructor mn tcon dcon) =
483+ line $ "Module " ++ show mn ++ " does not export data constructor " ++ show dcon ++ " for type " ++ show tcon
484+ goSimple (UnknownExportDataConstructor tcon dcon) =
485+ line $ "Cannot export data constructor " ++ show dcon ++ " for type " ++ show tcon ++ " as it has not been declared"
454486 goSimple (ConflictingImport nm mn) =
455487 line $ "Cannot declare " ++ show nm ++ " since another declaration of that name was imported from " ++ show mn
456488 goSimple (ConflictingImports nm m1 m2) =