/third_party/python/Lib/test/ |
D | test_typing.py | 29 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/ |
D | typing.rst | 70 *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/ |
D | graph-assembler.cc | 386 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()
|
D | loop-variable-optimizer.cc | 339 graph()->NewNode(common()->TypeGuard(phi_type), backedge_value, in ChangeToPhisAndInsertGuards()
|
D | escape-analysis-reducer.cc | 69 jsgraph()->common()->TypeGuard(original_type)); in ReplaceNode()
|
D | common-operator.h | 550 const Operator* TypeGuard(Type type); in NON_EXPORTED_BASE()
|
D | js-call-reducer.cc | 1050 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 …]
|
D | opcodes.h | 77 V(TypeGuard)
|
D | graph-assembler.h | 305 Node* TypeGuard(Type type, Node* value);
|
D | js-native-context-specialization.cc | 1329 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()
|
D | common-operator.cc | 1308 const Operator* CommonOperatorBuilder::TypeGuard(Type type) { in TypeGuard() function in v8::internal::compiler::CommonOperatorBuilder
|
D | load-elimination.cc | 950 graph()->NewNode(common()->TypeGuard(replacement_type), in ReduceLoadField()
|
D | bytecode-graph-builder.cc | 2858 constructor = NewNode(common()->TypeGuard(Type::Callable()), constructor); in VisitThrowIfNotSuperConstructor() 3611 index = NewNode(common()->TypeGuard(Type::UnsignedSmall()), index); in VisitForInNext()
|
D | js-typed-lowering.cc | 646 graph()->NewNode(common()->TypeGuard(type_cache_->kStringLengthType), in ReduceJSAdd()
|
/third_party/python/Lib/ |
D | typing.py | 606 def TypeGuard(self, parameters): function
|
/third_party/python/Misc/NEWS.d/ |
D | 3.10.0b1.rst | 918 :data:`TypeGuard`.
|
/third_party/python/Doc/whatsnew/ |
D | 3.10.rst | 797 :data:`TypeGuard` has been added to the :mod:`typing` module to annotate 799 during type narrowing. For more information, please see :data:`TypeGuard`\ 's
|