pub(crate) struct AccessPropertyOpts {
Show 13 fields pub do_not_validate_type_of_computed_prop: bool, pub disallow_indexing_array_with_string: bool, pub disallow_creating_indexed_type_from_ty_els: bool, pub disallow_indexing_class_with_computed: bool, pub return_rest_tuple_element_as_is: bool, pub use_undefined_for_tuple_index_error: bool, pub for_validation_of_indexed_access_type: bool, pub disallow_inexact: bool, pub check_for_undefined_or_null: bool, pub is_key_computed: bool, pub is_in_union: bool, pub do_not_use_any_for_object: bool, pub use_last_element_for_tuple_on_out_of_bound: bool,
}
Expand description

All fields defaults to default value of the type. (false for bool).

Fields

do_not_validate_type_of_computed_prop: booldisallow_indexing_array_with_string: booldisallow_creating_indexed_type_from_ty_els: bool

If true, access_property will not produce types like Array['b']

interface F {
  foo: string;
  bar: number;
}

 var obj11: F | string;

 obj11.foo; // Error TS2339
disallow_indexing_class_with_computed: boolreturn_rest_tuple_element_as_is: bool

If true, Type::Rest is returned as is.

use_undefined_for_tuple_index_error: bool

Note: If it’s in l-value context, access_property will return undefined even if this field is false.

for_validation_of_indexed_access_type: booldisallow_inexact: bool

If true, access_property will not return undefined for object literal types created with a spread.

This is true for destructuring variable declarations.

check_for_undefined_or_null: bool

Check if obj is undefined or null

is_key_computed: bool

true means that the provided Key is crated from a computed key.

is_in_union: bool

true means parent type is union

do_not_use_any_for_object: booluse_last_element_for_tuple_on_out_of_bound: bool

Used for rest elements or Type::Rest.

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
Returns the “default value” for a type. 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