1 // Copyright (c) Meta Platforms, Inc. and affiliates.
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
6 use crate::{typing::typing_error::Result, typing_decl_provider::Class};
8 use std::{fmt::Debug, rc::Rc};
9 use ty::reason::Reason;
10 pub trait Oracle<R: Reason>: Debug {
11 /// Get a class, return `None` if it can't be found.
12 fn get_class(&self, name: TypeName) -> Result<Option<Rc<dyn Class<R>>>>;
18 impl<R: Reason> Oracle<R> for NoClasses {
19 fn get_class(&self, _name: TypeName) -> Result<Option<Rc<dyn Class<R>>>> {