Lines Matching defs:classDef
71 auto *classDef = type->GetDeclNode()->AsClassDefinition();
73 if (classDef->Super() == nullptr) {
81 TypeStackElement tse(this, type, {"Cyclic inheritance involving ", type->Name(), "."}, classDef->Ident()->Start());
87 Type *superType = classDef->Super()->AsTypeNode()->GetType(this);
92 LogTypeError({"The super type of '", classDef->Ident()->Name(), "' class is not extensible."},
93 classDef->Super()->Start());
102 LogTypeError({"struct ", classDef->Ident()->Name(), " is not extensible."}, classDef->Super()->Start());
106 LogTypeError("Cannot inherit with 'final' modifier.", classDef->Super()->Start());
367 ETSObjectType *ETSChecker::BuildBasicClassProperties(ir::ClassDefinition *classDef)
369 if (classDef->IsFinal() && classDef->IsAbstract()) {
370 LogTypeError("Cannot use both 'final' and 'abstract' modifiers.", classDef->Start());
373 auto *var = classDef->Ident()->Variable();
376 const util::StringView &className = classDef->Ident()->Name();
380 classType = CreateETSObjectType(className, classDef, checker::ETSObjectFlags::CLASS);
383 if (classDef->IsAbstract()) {
390 classDef->SetTsType(classType);
393 if (classDef->TypeParams() != nullptr) {
402 if (classDef->IsInner()) {
417 ETSObjectType *ETSChecker::BuildAnonymousClassProperties(ir::ClassDefinition *classDef, ETSObjectType *superType)
419 auto classType = CreateETSObjectType(classDef->Ident()->Name(), classDef, checker::ETSObjectFlags::CLASS);
420 classDef->SetTsType(classType);
1009 void ETSChecker::CheckLocalClass(ir::ClassDefinition *classDef, CheckerStatus &checkerStatus)
1011 if (classDef->IsLocal()) {
1013 if (!classDef->Parent()->Parent()->IsBlockStatement()) {
1014 LogTypeError("Local classes must be defined between balanced braces", classDef->Start());
1019 void ETSChecker::CheckClassDefinition(ir::ClassDefinition *classDef)
1021 classDef->SetClassDefinitionChecked();
1022 auto *classType = classDef->TsTypeOrError()->AsETSObjectType();
1032 if (classDef->IsInner()) {
1037 classDef->IsGlobal() ? classType->AddObjectFlag(checker::ETSObjectFlags::GLOBAL)
1038 : CheckLocalClass(classDef, newStatus);
1040 checker::ScopeContext scopeCtx(this, classDef->Scope());
1045 if (classDef->IsAbstract()) {
1050 if (classDef->IsStatic() && !Context().ContainingClass()->HasObjectFlag(ETSObjectFlags::GLOBAL)) {
1056 if ((static_cast<ir::AstNode *>(classDef)->Modifiers() & ir::ModifierFlags::FUNCTIONAL) == 0) {
1057 ValidateOverriding(classType, classDef->Start());
1062 for (auto *it : classDef->Body()) {
1068 for (auto *it : classDef->Body()) {
1074 if (classDef->IsGlobal() || classType->SuperType() == nullptr) {
1078 CheckConstructors(classDef, classType);
1079 CheckValidInheritance(classType, classDef);
1085 void ETSChecker::CheckConstructors(ir::ClassDefinition *classDef, ETSObjectType *classType)
1087 if (!classDef->IsDeclare()) {
1105 void ETSChecker::CreateAsyncProxyMethods(ir::ClassDefinition *classDef)
1109 for (auto *it : classDef->Body()) {
1115 auto *proxy = CreateAsyncProxy(asyncMethod, classDef);
1123 auto *impl = CreateAsyncProxy(overload, classDef, false);
1130 it->SetParent(classDef);
1132 classDef->Body().push_back(it);
1917 void ETSChecker::CheckValidInheritance(ETSObjectType *classType, ir::ClassDefinition *classDef)
1923 if (classDef->TypeParams() != nullptr &&
1928 classDef->TypeParams()->Start());
1941 CheckProperties(classType, classDef, it, foundInSuper, interfaceFound);
1959 CheckProperties(classType, classDef, it, foundInInterface, interfaceFound);
1963 void ETSChecker::CheckProperties(ETSObjectType *classType, ir::ClassDefinition *classDef, varbinder::LocalVariable *it,
2008 classDef->Super()->Start());
2015 auto *const classDef = classType->GetDeclNode()->AsClassDefinition();
2033 for (auto it = classDef->Body().begin(); it != classDef->Body().end(); ++it) {
2035 classDef->Body().erase(it);