Skip to content

Commit

Permalink
Removed "method fn" hack (finally!)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppolesiuk committed Jan 24, 2025
1 parent 627eb01 commit 8b871f1
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/DblParser/Desugar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,6 @@ and tr_def ?(public=false) (def : Raw.def) =
| LP_Pat _ ->
Error.fatal (Error.desugar_error p.pos)
]
| DMethodFn(pub, id1, id2) ->
let public = public || pub in
[ make (DMethodFn(public, tr_var_id (make id1), tr_var_id (make id2))) ]
| DParam fld ->
[ match tr_param_decl fld with
| Either.Left (x, y, k) -> make (DTypeParam(x, y, k))
Expand Down
3 changes: 0 additions & 3 deletions src/DblParser/Raw.ml
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ and def_data =
| DMethod of is_public * expr * expr
(** Method definition *)

| DMethodFn of is_public * var_id * var_id
(** Declaration of function that should be interpreted as a method *)

| DModule of is_public * module_name * def list
(** Definition of a module *)

Expand Down
2 changes: 0 additions & 2 deletions src/DblParser/YaccParser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ def
| pub KW_HANDLE rec_opt expr_100 effect_var_opt KW_WITH expr
{ make_def $3 (DHandleWith($1, $4, $5, $7)) }
| pub KW_METHOD rec_opt expr_70 EQ expr { make_def $3 (DMethod($1, $4, $6)) }
| pub KW_METHOD KW_FN var_id { make (DMethodFn($1, $4, $4)) }
| pub KW_METHOD KW_FN var_id EQ var_id { make (DMethodFn($1, $4, $6)) }
| pub KW_MODULE rec_opt UID def_list KW_END
{ make_def $3 (DModule($1, $4, $5)) }
| pub KW_REC def_list KW_END { make (DRec($1, $3)) }
Expand Down
3 changes: 0 additions & 3 deletions src/Lang/Surface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ and def_data =
| DLetPat of pattern * expr
(** Let definition combined with pattern-matching. Always monomorphic *)

| DMethodFn of is_public * var * method_name
(** Declaration of function that should be interpreted as a method *)

| DLabel of type_arg * pattern
(** Creating a new label. *)

Expand Down
3 changes: 0 additions & 3 deletions src/TypeInference/Def.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ let check_def : type st dir. tcfix:tcfix ->
er_constr = body.er_constr @ rest.er_constr
}

| DMethodFn(public, x, method_name) ->
failwith "We are going to remove method functions"

| DLabel(eff, pat) ->
let (tp, resp) = switch_to_check_mode env req in
let delim_tp = Env.fresh_uvar env T.Kind.k_type in
Expand Down
3 changes: 0 additions & 3 deletions src/TypeInference/RecDefs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ let rec prepare_rec_data env (def : S.def) =
| DLetPat _ ->
Error.fatal (Error.invalid_rec_def ~pos:def.pos)

| DMethodFn _ ->
failwith "We are going to remove method functions"

| DLabel(eff, pat) ->
let (env, _, x) = Type.check_type_arg env eff T.Kind.k_effect in
begin match pat.data with
Expand Down

0 comments on commit 8b871f1

Please sign in to comment.