|
@@ -134,7 +134,7 @@ let get_constructor ctx c params p =
|
|
|
|
|
|
let check_constructor_access ctx c f p =
|
|
let check_constructor_access ctx c f p =
|
|
if (Meta.has Meta.CompilerGenerated f.cf_meta) then display_error ctx (error_msg (No_constructor (TClassDecl c))) p;
|
|
if (Meta.has Meta.CompilerGenerated f.cf_meta) then display_error ctx (error_msg (No_constructor (TClassDecl c))) p;
|
|
- if not (can_access ctx c f true || is_parent c ctx.curclass) && not ctx.untyped then display_error ctx (Printf.sprintf "Cannot access private constructor of %s" (s_class_path c)) p
|
|
|
|
|
|
+ if not (can_access ctx c f true || extends ctx.curclass c) && not ctx.untyped then display_error ctx (Printf.sprintf "Cannot access private constructor of %s" (s_class_path c)) p
|
|
|
|
|
|
let check_no_closure_meta ctx fa mode p =
|
|
let check_no_closure_meta ctx fa mode p =
|
|
if mode <> MCall && not (DisplayPosition.display_position#enclosed_in p) then begin
|
|
if mode <> MCall && not (DisplayPosition.display_position#enclosed_in p) then begin
|
|
@@ -201,7 +201,7 @@ let field_access ctx mode f fmode t e p =
|
|
match (match mode with MGet | MCall -> v.v_read | MSet -> v.v_write) with
|
|
match (match mode with MGet | MCall -> v.v_read | MSet -> v.v_write) with
|
|
| AccNo when not (Meta.has Meta.PrivateAccess ctx.meta) ->
|
|
| AccNo when not (Meta.has Meta.PrivateAccess ctx.meta) ->
|
|
(match follow e.etype with
|
|
(match follow e.etype with
|
|
- | TInst (c,_) when is_parent c ctx.curclass || can_access ctx c { f with cf_flags = unset_flag f.cf_flags (int_of_class_field_flag CfPublic) } false -> normal()
|
|
|
|
|
|
+ | TInst (c,_) when extends ctx.curclass c || can_access ctx c { f with cf_flags = unset_flag f.cf_flags (int_of_class_field_flag CfPublic) } false -> normal()
|
|
| TAnon a ->
|
|
| TAnon a ->
|
|
(match !(a.a_status) with
|
|
(match !(a.a_status) with
|
|
| Opened when mode = MSet ->
|
|
| Opened when mode = MSet ->
|