Skip to content

Commit ab82248

Browse files
committed
cleanup
1 parent 13266e1 commit ab82248

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/typing/typeload.ml

+8-7
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ let rec load_params ctx info params p =
304304
let is_java_rest = ctx.com.platform = Jvm && info.build_extern in
305305
let is_rest = is_rest || is_java_rest in
306306
let load_param t def =
307-
match (t, def) with
308-
| TPExpr e, _ ->
307+
match t with
308+
| TPExpr e ->
309309
let name = (match fst e with
310310
| EConst (String(s,_)) -> "S" ^ s
311311
| EConst (Int (_,_) as c) -> "I" ^ s_constant c
@@ -318,11 +318,12 @@ let rec load_params ctx info params p =
318318
let c = mk_class ctx.m.curmod ([],name) p (pos e) in
319319
c.cl_kind <- KExpr e;
320320
TInst (c,[]),pos e
321-
| TPType (CTPath({ path = { tpackage = ["$"]; tname = "_hx_default" }}),p), None ->
322-
raise_typing_error "Cannot apply default type parameter on non-default type parameter" p
323-
| TPType (CTPath({ path = { tpackage = ["$"]; tname = "_hx_default" }}),p), Some def ->
324-
def,p
325-
| TPType t, _ ->
321+
| TPType (CTPath({ path = { tpackage = ["$"]; tname = "_hx_default" }}),p) ->
322+
(match def with
323+
| Some def -> def,p
324+
| None -> raise_typing_error "Cannot apply default type parameter on non-default type parameter" p
325+
)
326+
| TPType t ->
326327
load_complex_type ctx true LoadNormal t,pos t
327328
in
328329
let checks = DynArray.create () in

0 commit comments

Comments
 (0)