2 * Copyright (c) 2018, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
16 inherit Tast_visitor.handler_base
18 method! at_Call env _ expr _ _ _
=
20 (* If rhs's expression is some Id, then we've got a normal function call
22 * That's totally fine, ignore it. *)
23 | Obj_get
(_
, (_
, Id _
), _
) -> ()
24 (* Otherwise, rhs is some dynamic invocation expression like: $x->$f *)
25 (* if lhs is already dynamic, we let the dynamic invoke happen for now *)
26 | Obj_get
(((_
, (_
, Tdynamic
)), _
), _
, _
) -> ()
27 (* if it's not dynamic, then we're in our error case. Grab the offending
28 * expression's position and report it *)
29 | Obj_get
(_
, ((rhs_pos
, _
), _
), _
)
30 when Env.is_strict env
->
31 Errors.dynamic_method_call rhs_pos