Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
f432f362
Verified
Commit
f432f362
authored
Jul 22, 2019
by
Camil Staps
Browse files
Prevent runtime error on illegal type arguments in generic function definitions (fixes #43)
parent
8ff09d11
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/parse.icl
View file @
f432f362
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment