Verified Commit f432f362 authored by Camil Staps's avatar Camil Staps
Browse files

Prevent runtime error on illegal type arguments in generic function definitions (fixes #43)

parent 8ff09d11
......@@ -586,6 +586,9 @@ where
wantGenericFunctionDefinition name pos pState
//# (type, pState) = wantType pState
# (ok, {at_type=type}, pState) = trySimpleType TA_None pState
| not ok
# pState = parseError "type argument" No "type constructor" pState
= (False, abort "no TypeCons", pState)
# (ident, pState) = stringToIdent name (IC_GenericCase type) pState
# (generic_ident, pState) = stringToIdent name IC_Generic pState
# (type_cons, pState) = get_type_cons type pState
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment