diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/type_check.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/type_check.ml b/src/type_check.ml index 2b558421..2ce7aebf 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -743,6 +743,9 @@ end = struct let add_local id mtyp env = begin wf_typ env (snd mtyp); + if Bindings.mem id env.top_val_specs then + typ_error (id_loc id) ("Local variable " ^ string_of_id id ^ " is already bound as a function name") + else (); typ_print ("Adding local binding " ^ string_of_id id ^ " :: " ^ string_of_mtyp mtyp); { env with locals = Bindings.add id mtyp env.locals } end |
