Avoid using decl_class_type wherever possible
[hiphop-php.git] / hphp / hack / src / typing / tast_check / pseudofunctions_check.ml
blob42e55f2ffc45dde2c00eb0f0d05ff1852f5e1f82
1 (**
2 * Copyright (c) 2018, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 open Tast
12 module Env = Tast_env
13 module SN = Naming_special_names
15 let handler = object
16 inherit Tast_visitor.handler_base
18 method! at_expr env ((p, _), x) =
19 if Env.is_strict env then
20 match x with
21 | Id (_, pseudo_func) when pseudo_func = SN.PseudoFunctions.isset ->
22 Errors.isset_in_strict p
23 | Id (_, pseudo_func) when pseudo_func = SN.PseudoFunctions.empty ->
24 Errors.empty_in_strict p
25 | _ -> ()
26 end