pub(super) struct InferData {
type_params: FxHashMap<Id, InferenceInfo>,
errored: FxHashSet<Id>,
defaults: FxHashMap<Id, Type>,
dejavu: Vec<(Type, Type)>,
skip_generalization: bool,
priority: InferencePriority,
contravariant: bool,
}
Fields
type_params: FxHashMap<Id, InferenceInfo>
Inferred type parameters
errored: FxHashSet<Id>
defaults: FxHashMap<Id, Type>
For the code below, we can know that T
defaults to unknown
while
inferring type of function parameters. We cannot know the type before
it. So we store the default type while it.
declare function one<T>(handler: (t: T) => void): T
var empty = one(() => {
});
dejavu: Vec<(Type, Type)>
skip_generalization: bool
priority: InferencePriority
contravariant: bool
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for InferData
impl Send for InferData
impl Sync for InferData
impl Unpin for InferData
impl UnwindSafe for InferData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more