@@ -118,6 +118,7 @@ errorCode em = case unwrapErrorMessage em of
118118 ConstrainedTypeUnified{} -> "ConstrainedTypeUnified"
119119 OverlappingInstances{} -> "OverlappingInstances"
120120 NoInstanceFound{} -> "NoInstanceFound"
121+ UnknownClass{} -> "UnknownClass"
121122 PossiblyInfiniteInstance{} -> "PossiblyInfiniteInstance"
122123 CannotDerive{} -> "CannotDerive"
123124 InvalidNewtypeInstance{} -> "InvalidNewtypeInstance"
@@ -599,6 +600,11 @@ prettyPrintSingleError (PPEOptions codeColor full level showWiki) e = flip evalS
599600 , line "They may be disallowed completely in a future version of the compiler."
600601 ]
601602 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."
607+ ]
602608 renderSimpleErrorMessage (NoInstanceFound (Constraint C.Fail [ ty ] _)) | Just box <- toTypelevelString ty =
603609 paras [ line "A custom type error occurred while solving type class constraints:"
604610 , indent box