Skip to content

Commit

Permalink
don't allow type parameters constraints for local functions (not enfo…
Browse files Browse the repository at this point in the history
…rced)
  • Loading branch information
ncannasse committed Jul 5, 2012
1 parent b92d6c7 commit c47ede1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion typer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,8 @@ and type_expr ctx ?(need_val=true) (e,p) =
type_unop ctx op flag e p
| EFunction (name,f) ->
let params = Typeload.type_function_params ctx f "localfun" p in
if params <> [] && name = None then error("Type parameters not supported in unnamed local functions") p;
if params <> [] && name = None then display_error ctx "Type parameters not supported in unnamed local functions" p;
List.iter (fun (_,c) -> if c <> [] then display_error ctx "Type parameters constraints are not supported for local functions" p) f.f_params;
let old = ctx.type_params in
ctx.type_params <- params @ ctx.type_params;
let rt = Typeload.load_type_opt ctx p f.f_type in
Expand Down

0 comments on commit c47ede1

Please sign in to comment.