Home
last modified time | relevance | path

Searched refs:TypeGuard (Results 1 – 17 of 17) sorted by relevance

/third_party/python/Lib/test/
Dtest_typing.py29 from typing import TypeGuard
2441 TypeGuard[int],
4785 TypeGuard[int] # OK
4787 def foo(arg) -> TypeGuard[int]: ...
4788 self.assertEqual(gth(foo), {'return': TypeGuard[int]})
4791 self.assertEqual(repr(TypeGuard), 'typing.TypeGuard')
4792 cv = TypeGuard[int]
4794 cv = TypeGuard[Employee]
4796 cv = TypeGuard[tuple[int]]
4801 class C(type(TypeGuard)):
[all …]
/third_party/python/Doc/library/
Dtyping.rst70 *Introducing* :data:`TypeGuard`
979 .. data:: TypeGuard
982 type guard function. ``TypeGuard`` only accepts a single type argument.
985 ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
1001 as a type guard. Such a function should use ``TypeGuard[...]`` as its
1004 Using ``-> TypeGuard`` tells the static type checker that for a given
1009 is the type inside ``TypeGuard``.
1013 def is_str_list(val: List[object]) -> TypeGuard[List[str]]:
1026 ``TypeGuard`` maps to the type of the second parameter after ``cls`` or
1029 In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``,
[all …]
/third_party/node/deps/v8/src/compiler/
Dgraph-assembler.cc386 Node* GraphAssembler::TypeGuard(Type type, Node* value) { in TypeGuard() function in v8::internal::compiler::GraphAssembler
388 graph()->NewNode(common()->TypeGuard(type), value, effect(), control())); in TypeGuard()
Dloop-variable-optimizer.cc339 graph()->NewNode(common()->TypeGuard(phi_type), backedge_value, in ChangeToPhisAndInsertGuards()
Descape-analysis-reducer.cc69 jsgraph()->common()->TypeGuard(original_type)); in ReplaceNode()
Dcommon-operator.h550 const Operator* TypeGuard(Type type); in NON_EXPORTED_BASE()
Djs-call-reducer.cc1050 return TNode<Smi>::UncheckedCast(TypeGuard(Type::UnsignedSmall(), value)); in TypeGuardUnsignedSmall()
1055 return TNode<Object>::UncheckedCast(TypeGuard(Type::NonInternal(), value)); in TypeGuardNonInternal()
1063 TypeGuard(TypeCache::Get()->kFixedArrayLengthType, value)); in TypeGuardFixedArrayLength()
1228 TypeGuard(Type::UnsignedSmall(), NumberAdd(k, clamped_start))); in ReduceStringPrototypeStartsWith()
1270 TypeGuard(Type::UnsignedSmall(), NumberAdd(k, clamped_start))); in ReduceStringPrototypeStartsWith()
5398 common()->TypeGuard(Type::UnsignedSmall()), initStart, effect, control); in ReduceStringPrototypeSubstr()
5409 common()->TypeGuard(Type::UnsignedSmall()), in ReduceStringPrototypeSubstr()
5956 graph()->NewNode(common()->TypeGuard(Type::UnsignedSmall()), in ReduceArrayPrototypeShift()
7561 common()->TypeGuard(TypeCache::Get()->kFixedArrayLengthType), index, in ReduceCollectionIteratorPrototypeNext()
7625 common()->TypeGuard(TypeCache::Get()->kFixedArrayLengthType), iloop, in ReduceCollectionIteratorPrototypeNext()
[all …]
Dopcodes.h77 V(TypeGuard)
Dgraph-assembler.h305 Node* TypeGuard(Type type, Node* value);
Djs-native-context-specialization.cc1329 graph()->NewNode(common()->TypeGuard(Type::String()), in ReduceNamedAccess()
3335 hash = effect = graph()->NewNode(common()->TypeGuard(Type::SignedSmall()), in BuildExtendPropertiesBackingStore()
3352 graph()->NewNode(common()->TypeGuard(Type::SignedSmall()), in BuildExtendPropertiesBackingStore()
Dcommon-operator.cc1308 const Operator* CommonOperatorBuilder::TypeGuard(Type type) { in TypeGuard() function in v8::internal::compiler::CommonOperatorBuilder
Dload-elimination.cc950 graph()->NewNode(common()->TypeGuard(replacement_type), in ReduceLoadField()
Dbytecode-graph-builder.cc2858 constructor = NewNode(common()->TypeGuard(Type::Callable()), constructor); in VisitThrowIfNotSuperConstructor()
3611 index = NewNode(common()->TypeGuard(Type::UnsignedSmall()), index); in VisitForInNext()
Djs-typed-lowering.cc646 graph()->NewNode(common()->TypeGuard(type_cache_->kStringLengthType), in ReduceJSAdd()
/third_party/python/Lib/
Dtyping.py606 def TypeGuard(self, parameters): function
/third_party/python/Misc/NEWS.d/
D3.10.0b1.rst918 :data:`TypeGuard`.
/third_party/python/Doc/whatsnew/
D3.10.rst797 :data:`TypeGuard` has been added to the :mod:`typing` module to annotate
799 during type narrowing. For more information, please see :data:`TypeGuard`\ 's