Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jsexplain
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verified Software
jsexplain
Commits
986448c6
Commit
986448c6
authored
9 years ago
by
Thomas Wood
Browse files
Options
Downloads
Patches
Plain Diff
Less ambiguous "Ambiguities when applying constructor" error
parent
b9a456fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generator/js_of_ast.ml
+4
-3
4 additions, 3 deletions
generator/js_of_ast.ml
with
4 additions
and
3 deletions
generator/js_of_ast.ml
+
4
−
3
View file @
986448c6
...
...
@@ -271,9 +271,10 @@ let find_type name =
let
tmp
=
Hashtbl
.
find_all
type_tbl
short_name
in
let
candidates
=
if
List
.
length
tmp
=
1
then
tmp
else
List
.
filter
(
fun
(
x
,
_
)
->
filter_on_prefixes
prefixes
(
short_name
::
x
))
tmp
in
(* print_string @@ print_candidates @@ (Hashtbl.find_all type_tbl short_name); print_newline (); *)
if
List
.
length
candidates
=
1
then
snd
@@
List
.
hd
candidates
else
failwith
(
"ambiguity when applying constructor "
^
name
)
match
candidates
with
|
[]
->
print_type_tbl
()
;
failwith
(
"no options for constructor "
^
name
)
|
c
::
[]
->
snd
c
|
_
->
print_type_tbl
()
;
failwith
(
"ambiguity when applying constructor "
^
name
)
(**
* Module managment part
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment