pub(crate) struct Ctx {
Show 60 fields module_id: ModuleId, in_class_member: bool, in_const_assertion: bool, in_constructor_param: bool, disallow_unknown_object_property: bool, use_undefined_for_empty_array_lit: bool, allow_module_var: bool, check_for_implicit_any: bool, array_lit_cannot_be_tuple: bool, prefer_tuple_for_array_lit: bool, in_shorthand: bool, is_instantiating_class: bool, in_cond: bool, should_store_truthy_for_access: bool, in_switch_case_test: bool, in_computed_prop_name: bool, in_opt_chain: bool, in_declare: bool, in_fn_without_body: bool, in_global: bool, in_export_assignment: bool, in_export_default_expr: bool, in_async: bool, in_generator: bool, is_calling_iife: bool, in_useless_expr_for_seq: bool, in_ts_fn_type: bool, in_actual_type: bool, report_error_for_non_local_vars: bool, in_static_property_initializer: bool, in_static_block: bool, in_static_method: bool, reevaluating_call_or_new: bool, reevaluating_argument: bool, ignore_errors: bool, var_kind: VarDeclKind, pat_mode: PatMode, computed_prop_mode: ComputedPropMode, allow_ref_declaring: bool, in_argument: bool, in_fn_with_return_type: bool, in_return_arg: bool, in_assign_rhs: bool, in_export_decl: bool, in_export_named: bool, skip_identical_while_inference: bool, super_references_super_class: bool, in_class_with_super: bool, cannot_fallback_to_iterable_iterator: bool, allow_new_target: bool, disallow_suggesting_property_on_no_var: bool, in_unreachable: bool, is_not_topmost_type: bool, is_fn_param: bool, in_module: bool, checking_switch_discriminant_as_bin: bool, obj_is_super: bool, use_properties_of_this_implicitly: bool, is_type_ann_for_call_reeval_chosen_from_overload: bool, is_type_predicate: bool,
}

Fields

module_id: ModuleIdin_class_member: bool

true for the body of class members. This is false for class keys of a non-nested class declaration.

in_const_assertion: boolin_constructor_param: booldisallow_unknown_object_property: booluse_undefined_for_empty_array_lit: boolallow_module_var: boolcheck_for_implicit_any: boolarray_lit_cannot_be_tuple: bool

If true, expression validator will not emit tuple.

prefer_tuple_for_array_lit: boolin_shorthand: boolis_instantiating_class: bool

Used to make type parameters unknown when it cannot be inferred.

in_cond: bool

true for condition of conditional expression or of an if statement.

should_store_truthy_for_access: boolin_switch_case_test: boolin_computed_prop_name: boolin_opt_chain: boolin_declare: boolin_fn_without_body: boolin_global: boolin_export_assignment: boolin_export_default_expr: boolin_async: boolin_generator: boolis_calling_iife: boolin_useless_expr_for_seq: boolin_ts_fn_type: boolin_actual_type: bool

true if unresolved references should be reported.

For example, while validating type parameter instantiation, unresolved references are error.

report_error_for_non_local_vars: bool

If true, type_of_raw_var should report an error if the referenced variable is global.

in_static_property_initializer: boolin_static_block: boolin_static_method: boolreevaluating_call_or_new: boolreevaluating_argument: boolignore_errors: bool

If true, all errors should be ignored.

Used to prevent wrong errors while validating loop bodies or etc.

var_kind: VarDeclKindpat_mode: PatModecomputed_prop_mode: ComputedPropModeallow_ref_declaring: boolin_argument: boolin_fn_with_return_type: boolin_return_arg: boolin_assign_rhs: boolin_export_decl: boolin_export_named: boolskip_identical_while_inference: boolsuper_references_super_class: boolin_class_with_super: bool

true if the ClassDef has the super class

cannot_fallback_to_iterable_iterator: bool

generatorReturnTypeFallback.3.ts says

Do not allow generators to fallback to IterableIterator while in strictNullChecks mode if they need a type for the sent value. NOTE: In non-strictNullChecks mode, undefined (the default sent value) is assignable to everything.

allow_new_target: booldisallow_suggesting_property_on_no_var: boolin_unreachable: bool

Should be modified directly instead of using with_ctx.

is_not_topmost_type: bool

true for top-level type annotations.

is_fn_param: boolin_module: boolchecking_switch_discriminant_as_bin: boolobj_is_super: bool

If true, obj of the expression statement is super keyword.

use_properties_of_this_implicitly: boolis_type_ann_for_call_reeval_chosen_from_overload: boolis_type_predicate: bool

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more