Commit b2fa63b8 authored by Andrei Paskevich's avatar Andrei Paskevich

do not accept variables in constructor declarations.

Earlier we anticipated declaring projections in this way,
but never implemented it, and I still think this would
be a hack, not in line with the rest of the language.
Anyway, it's a three-line change, easily revertible.
parent 6d476c7c
......@@ -313,7 +313,7 @@ typecases:
;
typecase:
| uident params { (loc_i 1,$1,$2) }
| uident primitive_types { (loc_i 1,$1,$2) }
;
inddefn:
......
......@@ -103,7 +103,7 @@ type param = ident option * pty
type type_def =
| TDabstract
| TDalias of pty
| TDalgebraic of (loc * ident * param list) list
| TDalgebraic of (loc * ident * pty list) list
type type_decl = {
td_loc : loc;
......
......@@ -718,7 +718,7 @@ let add_types dl th =
| TDalgebraic cl ->
let ty = ty_app ts (List.map ty_var ts.ts_args) in
let constructor (loc, id, pl) =
let param (_, t) = ty_of_dty (dty th' t) in
let param t = ty_of_dty (dty th' t) in
let tyl = List.map param pl in
Hashtbl.replace csymbols id.id loc;
create_fsymbol (id_user id.id loc) tyl ty
......
Markdown is supported
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