Skip to content

Commit e6fbf8f

Browse files
committed
remove is_valid_identifier checks for object inlining
escaping is still an open question
1 parent 32d9084 commit e6fbf8f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/optimization/inlineConstructors.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ let inline_constructors ctx e =
274274
end
275275
| TNew({ cl_constructor = Some ({cf_kind = Method MethInline; cf_expr = Some _} as cf)} as c,_,pl),_ when is_extern_ctor c cf ->
276276
error "Extern constructor could not be inlined" e.epos;
277-
| TObjectDecl fl, _ when captured && fl <> [] && List.for_all (fun((s,_,_),_) -> Lexer.is_valid_identifier s) fl -> (* TODO: check what we wanna do with is_valid_identifier here *)
277+
| TObjectDecl fl, _ when captured && fl <> [] ->
278278
let v = alloc_var VGenerated "inlobj" e.etype e.epos in
279279
let ev = mk (TLocal v) v.v_type e.epos in
280280
let el = List.map (fun ((s,_,_),e) ->

src/optimization/optimizer.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ let inline_constructors ctx e =
471471
begin try
472472
let ev = mk (TLocal v) v.v_type e.epos in
473473
let el = List.fold_left (fun acc ((s,_,_),e) ->
474-
if not (Lexer.is_valid_identifier s) then raise Exit; (* TODO: check what we wanna do with is_valid_identifier here *)
475474
let ef = mk (TField(ev,FDynamic s)) e.etype e.epos in
476475
let e = mk (TBinop(OpAssign,ef,e)) e.etype e.epos in
477476
e :: acc

0 commit comments

Comments
 (0)