Fix: Add unqualified type constructor lookup as fallback in WarnCheck
Unfortunately, #85 (closed) seems to be not quite resolved by !30 (merged), since compiling KiCS2 (with PAKCS) yields the following error message:
[64 of 64] Compiling Compile ( Compile.curry, .curry/Compile.fcy )
pakcs-frontend: Internal error: Checks.WarnCheck.getTyCons: QualIdent {qidSpanInfo = SpanInfo {srcSpan = Span {file = ".curry/FlatCurry/Annotated/Types.icurry", start = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 6}, end = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 29}}, srcInfoPoints = [Span {file = ".curry/FlatCurry/Annotated/Types.icurry", start = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 6}, end = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 29}}]}, qidModule = Just (ModuleIdent {midSpanInfo = SpanInfo {srcSpan = Span {file = ".curry/FlatCurry/Annotated/Types.icurry", start = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 6}, end = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 21}}, srcInfoPoints = []}, midQualifiers = ["FlatCurry","Types"]}), qidIdent = Ident {idSpanInfo = SpanInfo {srcSpan = Span {file = ".curry/FlatCurry/Annotated/Types.icurry", start = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 22}, end = Position {file = ".curry/FlatCurry/Annotated/Types.icurry", line = 59, column = 29}}, srcInfoPoints = []}, idName = "TypeExpr", idUnique = 0}} []
TopEnv ...
As a quick fix, this merge request adds back the old, unqualified type constructor lookup in the WarnCheck as a fallback solution, until we have something better:
csResult = getTyCons' (qualLookupTypeInfo tc tcEnv)
<|> getTyCons' (qualLookupTypeInfo tc' tcEnv)
<|> getTyCons' (lookupTypeInfo (unqualify tc) tcEnv) -- Fall back on unqualified lookup if qualified doesn't work