/arkcompiler/ets_frontend/ets2panda/checker/ets/ |
D | typeRelationContext.cpp | 44 checker_->CheckNumberOfTypeArguments(type, typeArgs, pos); in ValidateTypeArguments() 70 … : checker_->MaybePromotedBuiltinType(typeArgs->Params().at(idx)->GetType(checker_))}; in ValidateTypeArguments() 73 auto *const substitution = checker_->NewSubstitution(); in ValidateTypeArguments() 77 checker_->CheckValidGenericTypeParameter(typeArg, pos); in ValidateTypeArguments() 78 typeArg->Substitute(checker_->Relation(), substitution); in ValidateTypeArguments() 87 …auto *const constraint = typeParam->GetConstraintType()->Substitute(checker_->Relation(), substitu… in ValidateTypeArguments() 90 !checker_->Relation()->NoThrowGenericTypeAlias()) { in ValidateTypeArguments() 91 …checker_->ThrowTypeError({"Type '", typeArg, "' is not assignable to constraint type '", constrain… in ValidateTypeArguments() 105 return checker_->Relation()->IsAssignableTo(typeArg, constraintType); in ValidateTypeArg() 110 ArenaVector<Type *> typeArgTypes(checker_->Allocator()->Adapter()); in InstantiateType() [all …]
|
D | typeConverter.cpp | 20 : checker_(checker), relation_(relation), target_(target), source_(source) in TypeConverter() 51 return checker_; in Checker()
|
D | aliveAnalyzer.cpp | 161 checker_->ThrowTypeError("Initializer must be able to complete normally.", node->Start()); in AnalyzeDef() 172 checker_->ThrowTypeError("Unreachable statement.", node->Start()); in AnalyzeStat() 277 …const auto isVoid = returnType->IsETSVoidType() || returnType == checker_->GlobalBuiltinVoidType(); in AnalyzeMethodDef() 283 isPromiseVoid = asAsync->GetPromiseTypeArg() == checker_->GlobalBuiltinVoidType(); in AnalyzeMethodDef() 287 …checker_->ThrowTypeError("Function with a non void return type must return a value.", func->Id()->… in AnalyzeMethodDef() 407 …if (callExpr->Signature()->ReturnType() == checker_->GetGlobalTypesHolder()->GlobalBuiltinNeverTyp… in AnalyzeCall() 439 checker_->Warning("Possible fall-through into case", caseClause->Start()); in AnalyzeSwitch()
|
D | aliveAnalyzer.h | 37 AliveAnalyzer(const ir::AstNode *node, ETSChecker *checker) : BaseAnalyzer(), checker_(checker) in AliveAnalyzer() 83 ETSChecker *checker_; variable
|
D | typeRelationContext.h | 140 : checker_(checker) in InstantiationContext() 150 : checker_(checker) in InstantiationContext() 174 ETSChecker *checker_; variable
|
D | typeConverter.h | 35 ETSChecker *checker_;
|
/arkcompiler/ets_frontend/es2panda/typescript/core/ |
D | destructuringContext.cpp | 33 typeAnnotation->Check(checker_); in Prepare() 34 Type *annotationType = typeAnnotation->AsTypeNode()->GetType(checker_); in Prepare() 37 checker_->ElaborateElementwise(annotationType, initializer, loc); in Prepare() 50 inferedType_ = initializer->Check(checker_); in Prepare() 58 checker_->ThrowTypeError({"Cannot find name '", ident->Name(), "'."}, ident->Start()); in HandleDestructuringAssignment() 64 if (defaultType && !checker_->IsTypeAssignableTo(defaultType, variable->TsType())) { in HandleDestructuringAssignment() 65 checker_->ThrowAssignmentError(defaultType, variable->TsType(), ident->Start()); in HandleDestructuringAssignment() 68 if (inferedType && !checker_->IsTypeAssignableTo(inferedType, variable->TsType())) { in HandleDestructuringAssignment() 69 checker_->ThrowAssignmentError(inferedType, variable->TsType(), ident->Start()); in HandleDestructuringAssignment() 78 if (!checker_->HasStatus(CheckerStatus::IN_CONST_CONTEXT)) { in SetInferedTypeForVariable() [all …]
|
D | typeElaborationContext.cpp | 31 ArenaVector<Type *> bestMatchingType(checker_->Allocator()->Adapter()); in GetBestMatchingType() 32 … Type *sourceType = sourceNode ? checker_->CheckTypeCached(sourceNode) : checker_->GlobalAnyType(); in GetBestMatchingType() 35 Type *currentType = checker_->GetPropertyTypeForIndexType(*it, indexType); in GetBestMatchingType() 42 if (!checker_->IsTypeAssignableTo(sourceType, currentType)) { in GetBestMatchingType() 51 return checker_->CreateUnionType(std::move(bestMatchingType)); in GetBestMatchingType() 65 util::StringView memberIndex = util::Helpers::ToStringView(checker_->Allocator(), index_); in Start() 70 … targetElementType = GetBestMatchingType(checker_->CreateStringLiteralType(memberIndex), it); in Start() 73 …checker_->GetPropertyTypeForIndexType(targetType_, checker_->CreateStringLiteralType(memberIndex)); in Start() 80 checker_->ElaborateElementwise(targetElementType, it, it->Start()); in Start() 112 propKeyType = checker_->CheckComputedPropertyName(prop->Key()); in Start() [all …]
|
D | typeElaborationContext.h | 36 : checker_(checker), in ElaborationContext() 51 Checker *checker_;
|
D | destructuringContext.h | 36 …: checker_(checker), id_(id), inAssignment_(inAssignment), convertTupleToArray_(convertTupleToArra… in DestructuringContext() 76 Checker *checker_;
|
/arkcompiler/ets_frontend/ets2panda/checker/ts/ |
D | destructuringContext.cpp | 34 typeAnnotation->Check(checker_); in Prepare() 35 Type *annotationType = typeAnnotation->GetType(checker_); in Prepare() 38 checker_->ElaborateElementwise(annotationType, initializer, loc); in Prepare() 51 inferredType_ = initializer->Check(checker_); in Prepare() 58 checker_->ThrowTypeError({"Cannot find name '", ident->Name(), "'."}, ident->Start()); in HandleDestructuringAssignment() 64 if (defaultType != nullptr && !checker_->IsTypeAssignableTo(defaultType, variable->TsType())) { in HandleDestructuringAssignment() 65 checker_->ThrowAssignmentError(defaultType, variable->TsType(), ident->Start()); in HandleDestructuringAssignment() 68 … if (inferredType != nullptr && !checker_->IsTypeAssignableTo(inferredType, variable->TsType())) { in HandleDestructuringAssignment() 69 checker_->ThrowAssignmentError(inferredType, variable->TsType(), ident->Start()); in HandleDestructuringAssignment() 78 if (!checker_->HasStatus(CheckerStatus::IN_CONST_CONTEXT)) { in SetInferredTypeForVariable() [all …]
|
D | typeElaborationContext.cpp | 31 ArenaVector<Type *> bestMatchingType(checker_->Allocator()->Adapter()); in GetBestMatchingType() 32 …Type *sourceType = sourceNode != nullptr ? checker_->CheckTypeCached(sourceNode) : checker_->Globa… in GetBestMatchingType() 35 Type *currentType = checker_->GetPropertyTypeForIndexType(*it, indexType); in GetBestMatchingType() 42 if (!checker_->IsTypeAssignableTo(sourceType, currentType)) { in GetBestMatchingType() 51 return checker_->CreateUnionType(std::move(bestMatchingType)); in GetBestMatchingType() 65 util::StringView memberIndex = util::Helpers::ToStringView(checker_->Allocator(), index_); in Start() 70 … targetElementType = GetBestMatchingType(checker_->CreateStringLiteralType(memberIndex), it); in Start() 73 …checker_->GetPropertyTypeForIndexType(targetType_, checker_->CreateStringLiteralType(memberIndex)); in Start() 80 checker_->ElaborateElementwise(targetElementType, it, it->Start()); in Start() 112 propKeyType = checker_->CheckComputedPropertyName(prop->Key()); in Start() [all …]
|
D | typeElaborationContext.h | 36 : checker_(checker), in ElaborationContext() 52 TSChecker *checker_;
|
D | destructuringContext.h | 36 …: checker_(checker), id_(id), inAssignment_(inAssignment), convertTupleToArray_(convertTupleToArra… in DestructuringContext() 75 TSChecker *checker_;
|
/arkcompiler/ets_frontend/es2panda/typescript/types/ |
D | typeRelation.cpp | 29 TypeRelation::TypeRelation(Checker *checker) : checker_(checker), result_(RelationResult::FALSE) {} in TypeRelation() 38 return checker_; in GetChecker() 43 return checker_; in GetChecker() 48 return checker_->Allocator(); in Allocator() 82 result_ = CacheLookup(source, target, checker_->IdenticalResults(), RelationType::IDENTICAL); in IsIdenticalTo() 84 checker_->ResolveStructuredTypeMembers(source); in IsIdenticalTo() 85 checker_->ResolveStructuredTypeMembers(target); in IsIdenticalTo() 88 …checker_->IdenticalResults().cached.insert({{source->Id(), target->Id()}, {result_, RelationType::… in IsIdenticalTo() 122 result_ = CacheLookup(source, target, checker_->AssignableResults(), RelationType::ASSIGNABLE); in IsAssignableTo() 134 checker_->AssignableResults().cached.insert( in IsAssignableTo() [all …]
|
D | typeRelation.h | 108 Checker *checker_; variable
|
/arkcompiler/ets_frontend/ets2panda/checker/types/ |
D | typeRelation.cpp | 25 return checker_->Allocator(); in Allocator() 59 result_ = CacheLookup(source, target, checker_->IdenticalResults(), RelationType::IDENTICAL); in IsIdenticalTo() 61 checker_->ResolveStructuredTypeMembers(source); in IsIdenticalTo() 62 checker_->ResolveStructuredTypeMembers(target); in IsIdenticalTo() 65 …checker_->IdenticalResults().cached.insert({{source->Id(), target->Id()}, {result_, RelationType::… in IsIdenticalTo() 100 result_ = CacheLookup(source, target, checker_->AssignableResults(), RelationType::ASSIGNABLE); in IsAssignableTo() 113 checker_->AssignableResults().cached.insert( in IsAssignableTo() 123 result_ = CacheLookup(source, target, checker_->ComparableResults(), RelationType::COMPARABLE); in IsComparableTo() 139 checker_->ComparableResults().cached.insert( in IsComparableTo() 148 …result_ = CacheLookup(source, target, checker_->UncheckedCastableResult(), RelationType::UNCHECKED… in IsCastableTo() [all …]
|
D | typeRelation.h | 131 …: checker_(checker), result_(RelationResult::FALSE), instantiationRecursionMap_(Allocator()->Adapt… in TypeRelation() 212 return checker_; in GetChecker() 222 return checker_; in GetChecker() 306 Checker *checker_; variable
|
/arkcompiler/ets_frontend/ets2panda/checker/ |
D | checker.h | 226 : checker_(checker), element_(element) in TypeStackElement() 229 checker_->ThrowTypeError(list, pos); in TypeStackElement() 234 : checker_(checker), element_(element) in TypeStackElement() 237 checker_->ThrowTypeError(err, pos); in TypeStackElement() 243 checker_->typeStack_.erase(element_); in ~TypeStackElement() 250 Checker *checker_; 257 : checker_(checker), prevScope_(checker_->scope_) in ScopeContext() 259 checker_->scope_ = newScope; in ScopeContext() 264 checker_->scope_ = prevScope_; in ~ScopeContext() 271 Checker *checker_; [all …]
|
D | SemanticAnalyzer.h | 174 checker_ = checker; in SemanticAnalyzer() 193 return checker_; in AST_NODE_REINTERPRET_MAPPING() 197 Checker *checker_;
|
/arkcompiler/ets_frontend/ets2panda/compiler/core/ |
D | compilerContext.h | 49 …: varbinder_(varbinder), checker_(checker), options_(std::move(options)), codeGenCb_(std::move(cod… in CompilerContext() 65 return checker_; in Checker() 136 checker::Checker *checker_; variable
|
/arkcompiler/ets_frontend/es2panda/typescript/ |
D | checker.h | 501 …copeContext(Checker *checker, binder::Scope *newScope) : checker_(checker), prevScope_(checker_->s… in ScopeContext() 503 checker_->scope_ = newScope; in ScopeContext() 508 checker_->scope_ = prevScope_; in ~ScopeContext() 515 Checker *checker_; 522 : checker_(checker), prev_(checker->context_) in SavedCheckerContext() 524 checker_->context_ = CheckerContext(newStatus); in SavedCheckerContext() 532 checker_->context_ = prev_; in ~SavedCheckerContext() 536 Checker *checker_;
|
/arkcompiler/ets_frontend/ets2panda/util/ |
D | declgenEts2Ts.h | 32 : checker_(checker), program_(program) in TSDeclGen() 97 checker::ETSChecker *checker_ {};
|
D | declgenEts2Ts.cpp | 166 if (checker_->IsTypeBuiltinType(checkerType)) { in GenTypeNonNullish() 339 GenType(constraint->GetType(checker_)); in GenTypeParameters() 406 const auto *aliasedType = typeAlias->TypeAnnotation()->GetType(checker_); in GenTypeAliasDeclaration()
|