@@ -118,6 +118,7 @@ errorCode em = case unwrapErrorMessage em of
118 ConstrainedTypeUnified{} -> "ConstrainedTypeUnified"
118 ConstrainedTypeUnified{} -> "ConstrainedTypeUnified"
119 OverlappingInstances{} -> "OverlappingInstances"
119 OverlappingInstances{} -> "OverlappingInstances"
120 NoInstanceFound{} -> "NoInstanceFound"
120 NoInstanceFound{} -> "NoInstanceFound"
121+ UnknownClass{} -> "UnknownClass"
121 PossiblyInfiniteInstance{} -> "PossiblyInfiniteInstance"
122 PossiblyInfiniteInstance{} -> "PossiblyInfiniteInstance"
122 CannotDerive{} -> "CannotDerive"
123 CannotDerive{} -> "CannotDerive"
123 InvalidNewtypeInstance{} -> "InvalidNewtypeInstance"
124 InvalidNewtypeInstance{} -> "InvalidNewtypeInstance"
@@ -599,6 +600,11 @@ prettyPrintSingleError (PPEOptions codeColor full level showWiki) e = flip evalS
599 , line "They may be disallowed completely in a future version of the compiler."
600 , line "They may be disallowed completely in a future version of the compiler."
601 renderSimpleErrorMessage OverlappingInstances{} = internalError "OverlappingInstances: empty instance list"
602 renderSimpleErrorMessage OverlappingInstances{} = internalError "OverlappingInstances: empty instance list"
603+ renderSimpleErrorMessage (UnknownClass nm) =
604+ paras [ line "No type class instance was found for class"
605+ , markCodeBox $ indent $ line (showQualified runProperName nm)
606+ , line "because the class was not in scope. Perhaps it was not exported."
602 renderSimpleErrorMessage (NoInstanceFound (Constraint C.Fail [ ty ] _)) | Just box <- toTypelevelString ty =
608 renderSimpleErrorMessage (NoInstanceFound (Constraint C.Fail [ ty ] _)) | Just box <- toTypelevelString ty =
603 paras [ line "A custom type error occurred while solving type class constraints:"
609 paras [ line "A custom type error occurred while solving type class constraints:"
604 , indent box
610 , indent box