Skip to content

Commit

Permalink
Merge pull request HaxeFoundation#4376 from andyli/extern-field-name
Browse files Browse the repository at this point in the history
Allow extern to have field name that is used for both static and instance
  • Loading branch information
Simn committed Jul 1, 2015
2 parents 2885f7c + 0f7efe2 commit b753b1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typeload.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2707,7 +2707,7 @@ module ClassInitializer = struct
()
| FKNormal ->
let dup = if fctx.is_static then PMap.exists cf.cf_name c.cl_fields || has_field cf.cf_name c.cl_super else PMap.exists cf.cf_name c.cl_statics in
if not cctx.is_native && dup then error ("Same field name can't be use for both static and instance : " ^ cf.cf_name) p;
if not cctx.is_native && not c.cl_extern && dup then error ("Same field name can't be use for both static and instance : " ^ cf.cf_name) p;
if List.mem AOverride f.cff_access then c.cl_overrides <- cf :: c.cl_overrides;
let is_var f = match cf.cf_kind with | Var _ -> true | _ -> false in
if PMap.mem cf.cf_name (if fctx.is_static then c.cl_statics else c.cl_fields) then
Expand Down

0 comments on commit b753b1b

Please sign in to comment.