Struct stc_ts_file_analyzer::analyzer::Ctx
source · [−]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: ModuleId
in_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: 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
If true
, expression validator will not emit tuple.
prefer_tuple_for_array_lit: bool
in_shorthand: bool
is_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: 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
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: bool
in_static_block: bool
in_static_method: bool
reevaluating_call_or_new: bool
reevaluating_argument: bool
ignore_errors: bool
If true, all errors should be ignored.
Used to prevent wrong errors while validating loop bodies or etc.
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
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: bool
disallow_suggesting_property_on_no_var: bool
in_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: bool
in_module: bool
checking_switch_discriminant_as_bin: bool
obj_is_super: bool
If true, obj of the expression statement is super
keyword.
use_properties_of_this_implicitly: bool
is_type_ann_for_call_reeval_chosen_from_overload: bool
is_type_predicate: bool