• Home
  • Raw
  • Download

Lines Matching full:signature

95 …// Check if the type parameter is in the signature, and the type argument is not already in the re…  in InsertTypeIntoSubstitution()
297 Signature *ETSChecker::ValidateParameterlessConstructor(Signature *signature, const lexer::SourcePo… in ValidateParameterlessConstructor() argument
300 std::size_t const parameterCount = signature->MinArgCount(); in ValidateParameterlessConstructor()
309 return signature; in ValidateParameterlessConstructor()
312 bool ETSChecker::CheckOptionalLambdaFunction(ir::Expression *argument, Signature *substitutedSig, s… in CheckOptionalLambdaFunction()
335 bool ETSChecker::ValidateSignatureRequiredParams(Signature *substitutedSig, in ValidateSignatureRequiredParams()
399 bool ETSChecker::CheckInvokable(Signature *substitutedSig, ir::Expression *argument, std::size_t in… in CheckInvokable()
421 bool ETSChecker::ValidateSignatureInvocationContext(Signature *substitutedSig, ir::Expression *argu… in ValidateSignatureInvocationContext()
437 bool ETSChecker::ValidateSignatureRestParams(Signature *substitutedSig, const ArenaVector<ir::Expre… in ValidateSignatureRestParams()
553 Signature *ETSChecker::ValidateSignature( in ValidateSignature()
554 std::tuple<Signature *, const ir::TSTypeParameterInstantiation *, TypeRelationFlag> info, in ValidateSignature() argument
558 auto [signature, typeArguments, flags] = info; in ValidateSignature()
559Signature *substitutedSig = MaybeSubstituteTypeParameters(this, signature, typeArguments, argument… in ValidateSignature()
599 Signature *ETSChecker::CollectParameterlessConstructor(ArenaVector<Signature *> &signatures, in CollectParameterlessConstructor()
602 Signature *compatibleSignature = nullptr; in CollectParameterlessConstructor()
628 bool IsSignatureAccessible(Signature *sig, ETSObjectType *containingClass, TypeRelation *relation) in IsSignatureAccessible()
630 …// NOTE(vivienvoros): this check can be removed if signature is implicitly declared as public acco… in IsSignatureAccessible()
668 ArenaVector<Signature *> ETSChecker::CollectSignatures(ArenaVector<Signature *> &signatures, in CollectSignatures()
673 ArenaVector<Signature *> compatibleSignatures(Allocator()->Adapter()); in CollectSignatures()
675 Signature *notVisibleSignature = nullptr; in CollectSignatures()
697 // If there's only one signature, we don't need special checks for boxing/unboxing/widening. in CollectSignatures()
714 …{"Signature ", notVisibleSignature->Function()->Id()->Name(), notVisibleSignature, " is not visibl… in CollectSignatures()
720 Signature *ETSChecker::GetMostSpecificSignature(ArenaVector<Signature *> &compatibleSignatures, in GetMostSpecificSignature()
725Signature *mostSpecificSignature = ChooseMostSpecificSignature(compatibleSignatures, argTypeInfere… in GetMostSpecificSignature()
739 Signature *ETSChecker::ValidateSignatures(ArenaVector<Signature *> &signatures, in ValidateSignatures()
772 … LogTypeError({"No matching ", signatureKind, " signature for ", ss.str().c_str()}, pos); in ValidateSignatures()
781 LogTypeError({"No matching ", signatureKind, " signature"}, pos); in ValidateSignatures()
787 Signature *ETSChecker::FindMostSpecificSignature(const ArenaVector<Signature *> &signatures, in FindMostSpecificSignature()
788 … const ArenaMultiMap<size_t, Signature *> &bestSignaturesForParameter, in FindMostSpecificSignature()
791 Signature *mostSpecificSignature = nullptr; in FindMostSpecificSignature()
798 // Check if signature is most specific for i. parameter type. in FindMostSpecificSignature()
815 // The same signature in FindMostSpecificSignature()
824 static void InitMostSpecificType(const ArenaVector<Signature *> &signatures, [[maybe_unused]] Type … in InitMostSpecificType()
825 [[maybe_unused]] Signature *&prevSig, const size_t idx) in InitMostSpecificType()
838 Type *&mostSpecificType, Signature *&prevSig, in SearchAmongMostSpecificTypes()
839 …std::tuple<const lexer::SourcePosition &, size_t, size_t, size_t, Signature *> info, bool lookForC… in SearchAmongMostSpecificTypes()
866 ArenaMultiMap<size_t, Signature *> ETSChecker::GetSuitableSignaturesForParameter( in GetSuitableSignaturesForParameter()
867 …const std::vector<bool> &argTypeInferenceRequired, size_t paramCount, ArenaVector<Signature *> &si… in GetSuitableSignaturesForParameter()
871 …ArenaMultiMap<size_t /* parameter index */, Signature *> bestSignaturesForParameter(Allocator()->A… in GetSuitableSignaturesForParameter()
885 Signature *prevSig = signatures.front(); in GetSuitableSignaturesForParameter()
907 Signature *ETSChecker::ChooseMostSpecificSignature(ArenaVector<Signature *> &signatures, in ChooseMostSpecificSignature()
925 … [](auto *signature) { return signature->RestVar() == nullptr; }); in ChooseMostSpecificSignature() argument
926 // If there is a zero parameter signature, return that in ChooseMostSpecificSignature()
937 // Else return the signature with the rest parameter in ChooseMostSpecificSignature()
939 … [](auto *signature) { return signature->RestVar() != nullptr; }); in ChooseMostSpecificSignature() argument
943 ArenaMultiMap<size_t /* parameter index */, Signature *> bestSignaturesForParameter = in ChooseMostSpecificSignature()
945 // Find the signature that are most specific for all parameters. in ChooseMostSpecificSignature()
946Signature *mostSpecificSignature = FindMostSpecificSignature(signatures, bestSignaturesForParamete… in ChooseMostSpecificSignature()
951 Signature *ETSChecker::ResolveCallExpressionAndTrailingLambda(ArenaVector<Signature *> &signatures, in ResolveCallExpressionAndTrailingLambda()
956 Signature *sig = nullptr; in ResolveCallExpressionAndTrailingLambda()
989 Signature *ETSChecker::ResolveConstructExpression(ETSObjectType *type, const ArenaVector<ir::Expres… in ResolveConstructExpression()
999 void ETSChecker::CheckObjectLiteralArguments(Signature *signature, ArenaVector<ir::Expression *> co… in CheckObjectLiteralArguments() argument
1007 if (index >= signature->MinArgCount()) { in CheckObjectLiteralArguments()
1008 ASSERT(signature->RestVar()); in CheckObjectLiteralArguments()
1009 tp = signature->RestVar()->TsType(); in CheckObjectLiteralArguments()
1011 tp = signature->Params()[index]->TsType(); in CheckObjectLiteralArguments()
1029 if (method->Function()->Signature() == nullptr) { in BuildMethodSignature()
1038 if (currentFunc->Function()->Signature() == nullptr) { in BuildMethodSignature()
1044 funcType->AddCallSignature(currentFunc->Function()->Signature()); in BuildMethodSignature()
1072 …LogTypeError("Function " + func->Name().Mutf8() + " with this assembly signature already declared.… in CheckIdenticalOverloads()
1077 Signature *ETSChecker::ComposeSignature(ir::ScriptFunction *func, SignatureInfo *signatureInfo, Typ… in ComposeSignature()
1080 auto *signature = CreateSignature(signatureInfo, returnType, func); in ComposeSignature() local
1081 signature->SetOwner(Context().ContainingClass()); in ComposeSignature()
1082 signature->SetOwnerVar(nameVar); in ComposeSignature()
1086 signature->AddSignatureFlag(SignatureFlags::NEED_RETURN_TYPE); in ComposeSignature()
1090 signature->AddSignatureFlag(SignatureFlags::THIS_RETURN_TYPE); in ComposeSignature()
1094 signature->AddSignatureFlag(SignatureFlags::ABSTRACT); in ComposeSignature()
1095 signature->AddSignatureFlag(SignatureFlags::VIRTUAL); in ComposeSignature()
1099 signature->AddSignatureFlag(SignatureFlags::STATIC); in ComposeSignature()
1103 signature->AddSignatureFlag(SignatureFlags::CONSTRUCTOR); in ComposeSignature()
1106 …if ((signature->Owner() != nullptr && signature->Owner()->GetDeclNode()->IsFinal()) || func->IsFin… in ComposeSignature()
1107 signature->AddSignatureFlag(SignatureFlags::FINAL); in ComposeSignature()
1111 signature->AddSignatureFlag(SignatureFlags::PUBLIC); in ComposeSignature()
1114 signature->AddSignatureFlag(SignatureFlags::INTERNAL_PROTECTED); in ComposeSignature()
1116 signature->AddSignatureFlag(SignatureFlags::INTERNAL); in ComposeSignature()
1119 signature->AddSignatureFlag(SignatureFlags::PROTECTED); in ComposeSignature()
1121 signature->AddSignatureFlag(SignatureFlags::PRIVATE); in ComposeSignature()
1124 return signature; in ComposeSignature()
1281 static void AddSignatureFlags(const ir::ScriptFunction *const func, Signature *const signature) in AddSignatureFlags() argument
1284 signature->AddSignatureFlag(SignatureFlags::ABSTRACT); in AddSignatureFlags()
1285 signature->AddSignatureFlag(SignatureFlags::VIRTUAL); in AddSignatureFlags()
1289 signature->AddSignatureFlag(SignatureFlags::STATIC); in AddSignatureFlags()
1293 signature->AddSignatureFlag(SignatureFlags::CONSTRUCTOR); in AddSignatureFlags()
1296 …if ((func->Signature()->Owner() != nullptr && func->Signature()->Owner()->GetDeclNode()->IsFinal()… in AddSignatureFlags()
1298 signature->AddSignatureFlag(SignatureFlags::FINAL); in AddSignatureFlags()
1302 signature->AddSignatureFlag(SignatureFlags::PUBLIC); in AddSignatureFlags()
1305 signature->AddSignatureFlag(SignatureFlags::INTERNAL_PROTECTED); in AddSignatureFlags()
1307 signature->AddSignatureFlag(SignatureFlags::INTERNAL); in AddSignatureFlags()
1310 signature->AddSignatureFlag(SignatureFlags::PROTECTED); in AddSignatureFlags()
1312 signature->AddSignatureFlag(SignatureFlags::PRIVATE); in AddSignatureFlags()
1316 signature->AddSignatureFlag(SignatureFlags::SETTER); in AddSignatureFlags()
1318 signature->AddSignatureFlag(SignatureFlags::GETTER); in AddSignatureFlags()
1342 auto *signature = ComposeSignature(func, signatureInfo, returnType, nameVar); in BuildFunctionSignature() local
1344 signature->AddSignatureFlag(SignatureFlags::CONSTRUCT); in BuildFunctionSignature()
1346 signature->AddSignatureFlag(SignatureFlags::CALL); in BuildFunctionSignature()
1348 func->SetSignature(signature); in BuildFunctionSignature()
1349 AddSignatureFlags(func, signature); in BuildFunctionSignature()
1357 auto *funcType = CreateETSFunctionType(func, func->Signature(), nameVar->Name()); in BuildNamedFunctionType()
1362 Signature *ETSChecker::CheckEveryAbstractSignatureIsOverridden(ETSFunctionType *target, ETSFunction… in CheckEveryAbstractSignatureIsOverridden()
1388 bool ETSChecker::IsOverridableIn(Signature *signature) in IsOverridableIn() argument
1390 if (signature->HasSignatureFlag(SignatureFlags::PRIVATE)) { in IsOverridableIn()
1395 if (signature->HasSignatureFlag(SignatureFlags::PUBLIC | SignatureFlags::INTERNAL)) { in IsOverridableIn()
1399 return signature->HasSignatureFlag(SignatureFlags::PROTECTED); in IsOverridableIn()
1402 bool ETSChecker::IsMethodOverridesOther(Signature *base, Signature *derived) in IsMethodOverridesOther()
1434 bool ETSChecker::CheckThrowMarkers(Signature *source, Signature *target) in CheckThrowMarkers()
1454 OverrideErrorCode ETSChecker::CheckOverride(Signature *signature, Signature *other) in CheckOverride() argument
1457 ASSERT(signature->HasSignatureFlag(SignatureFlags::STATIC)); in CheckOverride()
1466 if (!IsReturnTypeSubstitutable(signature, other)) { in CheckOverride()
1472 if (!signature->ReturnType()->IsETSReferenceType()) { in CheckOverride()
1477 if (signature->ProtectionFlag() > other->ProtectionFlag()) { in CheckOverride()
1484 Signature *ETSChecker::AdjustForTypeParameters(Signature *source, Signature *target) in AdjustForTypeParameters()
1504 void ETSChecker::ReportOverrideError(Signature *signature, Signature *overriddenSignature, in ReportOverrideError() argument
1526 …LogTypeError({signature->Function()->Id()->Name(), signature, " in ", signature->Owner(), " cannot… in ReportOverrideError()
1529 signature->Function()->Start()); in ReportOverrideError()
1532 bool ETSChecker::CheckOverride(Signature *signature, ETSObjectType *site) in CheckOverride() argument
1534 …auto *target = site->GetProperty(signature->Function()->Id()->Name(), PropertySearchFlags::SEARCH_… in CheckOverride()
1542 auto *itSubst = AdjustForTypeParameters(signature, it); in CheckOverride()
1549 … if (site->HasObjectFlag(ETSObjectFlags::INTERFACE) && !CheckThrowMarkers(itSubst, signature)) { in CheckOverride()
1553 if ((itSubst->Function()->IsSetter() && !signature->Function()->IsSetter()) || in CheckOverride()
1554 (itSubst->Function()->IsGetter() && !signature->Function()->IsGetter())) { in CheckOverride()
1559 if (!IsMethodOverridesOther(itSubst, signature)) { in CheckOverride()
1563 if (auto err = CheckOverride(signature, itSubst); err != OverrideErrorCode::NO_ERROR) { in CheckOverride()
1564 ReportOverrideError(signature, it, err); in CheckOverride()
1568 if (signature->Owner()->HasObjectFlag(ETSObjectFlags::INTERFACE) && in CheckOverride()
1572 signature->Function()->Start()); in CheckOverride()
1583 void ETSChecker::CheckOverride(Signature *signature) in CheckOverride() argument
1585 auto *owner = signature->Owner(); in CheckOverride()
1593 isOverriding |= CheckInterfaceOverride(this, interface, signature); in CheckOverride()
1598 isOverriding |= CheckOverride(signature, iter); in CheckOverride()
1601 isOverriding |= CheckInterfaceOverride(this, interface, signature); in CheckOverride()
1607 if (!isOverriding && signature->Function()->IsOverride()) { in CheckOverride()
1608 …LogTypeError({"Method ", signature->Function()->Id()->Name(), signature, " in ", signature->Owner(… in CheckOverride()
1610 signature->Function()->Start()); in CheckOverride()
1614 Signature *ETSChecker::GetSignatureFromMethodDefinition(const ir::MethodDefinition *methodDef) in GetSignatureFromMethodDefinition()
1630Signature *signature, const lexer::SourcePosition &pos, in ValidateSignatureAccessibility() argument
1634 (!signature->HasSignatureFlag(SignatureFlags::PRIVATE) && in ValidateSignatureAccessibility()
1635 !signature->HasSignatureFlag(SignatureFlags::PROTECTED))) { in ValidateSignatureAccessibility()
1640 bool isContainingSignatureInherited = containingClass->IsSignatureInherited(signature); in ValidateSignatureAccessibility()
1648 signature->Function()->IsPrivate() && !enclosingFunc->IsPrivate()) { in ValidateSignatureAccessibility()
1660 bool isSignatureInherited = callee->IsSignatureInherited(signature); in ValidateSignatureAccessibility()
1662 if (!signature->HasSignatureFlag(SignatureFlags::PRIVATE) && in ValidateSignatureAccessibility()
1663 …((signature->HasSignatureFlag(SignatureFlags::PROTECTED) && containingClass->IsDescendantOf(callee… in ValidateSignatureAccessibility()
1670 …LogTypeError({"Signature ", signature->Function()->Id()->Name(), signature, " is not visible here.… in ValidateSignatureAccessibility()
1733 bool ETSChecker::AreOverrideEquivalent(Signature *const s1, Signature *const s2) in AreOverrideEquivalent()
1735 // Two functions, methods or constructors M and N have the same signature if in AreOverrideEquivalent()
1747 bool ETSChecker::IsReturnTypeSubstitutable(Signature *const s1, Signature *const s2) in IsReturnTypeSubstitutable()
1755 …: void type leaks into type arguments, so we have to check the original signature if the return ty… in IsReturnTypeSubstitutable()
1757 auto const hasPrimitiveReturnType = [](Signature *s) { in IsReturnTypeSubstitutable()
1758 bool origIsRef = s->Function()->Signature()->ReturnType()->IsETSReferenceType(); in IsReturnTypeSubstitutable()
1836 if (!asyncFunc->Signature()->HasSignatureFlag(SignatureFlags::NEED_RETURN_TYPE)) { in CreateAsyncImplMethod()
2110 LogTypeError({"No matching call signature with trailing lambda"}, callExpr->Start()); in EnsureValidCurlyBrace()
2156 bool ETSChecker::CmpAssemblerTypesWithRank(Signature const *const sig1, Signature const *const sig2… in CmpAssemblerTypesWithRank()
2171 bool ETSChecker::HasSameAssemblySignature(Signature const *const sig1, Signature const *const sig2)… in HasSameAssemblySignature()