diff --git a/ets2panda/checker/ETSAnalyzer.cpp b/ets2panda/checker/ETSAnalyzer.cpp index ec729cf22942eacc61d2ca5a674062973d981b88..a2f4303841bd4d79d696020ca4f6aae3195f25b1 100644 --- a/ets2panda/checker/ETSAnalyzer.cpp +++ b/ets2panda/checker/ETSAnalyzer.cpp @@ -20,14 +20,6 @@ #include "checker/ETSchecker.h" #include "checker/ets/castingContext.h" #include "checker/ets/typeRelationContext.h" -#include "ir/base/catchClause.h" -#include "ir/base/classProperty.h" -#include "ir/base/classStaticBlock.h" -#include "ir/expressions/identifier.h" -#include "ir/expressions/objectExpression.h" -#include "ir/expressions/arrayExpression.h" -#include "ir/statements/blockStatement.h" -#include "ir/statements/returnStatement.h" #include "util/helpers.h" namespace panda::es2panda::checker { @@ -1087,9 +1079,8 @@ checker::Type *ETSAnalyzer::Check(ir::TSModuleBlock *st) const UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSModuleDeclaration *st) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSModuleDeclaration *st) const { - (void)st; UNREACHABLE(); } @@ -1129,9 +1120,8 @@ checker::Type *ETSAnalyzer::Check(ir::TSObjectKeyword *node) const UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSParameterProperty *expr) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSParameterProperty *expr) const { - (void)expr; UNREACHABLE(); } @@ -1183,33 +1173,28 @@ checker::Type *ETSAnalyzer::Check(ir::TSTypeLiteral *node) const UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSTypeOperator *node) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSTypeOperator *node) const { - (void)node; UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSTypeParameter *expr) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSTypeParameter *expr) const { - (void)expr; UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSTypeParameterDeclaration *expr) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSTypeParameterDeclaration *expr) const { - (void)expr; UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSTypeParameterInstantiation *expr) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSTypeParameterInstantiation *expr) const { - (void)expr; UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check(ir::TSTypePredicate *node) const +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TSTypePredicate *node) const { - (void)node; UNREACHABLE(); } diff --git a/ets2panda/checker/TSAnalyzer.cpp b/ets2panda/checker/TSAnalyzer.cpp index d3e96e821ffd6bb149a2337acaa909ed200d7dca..4a9067cce36e2c619e372570bf8115450a9e6a86 100644 --- a/ets2panda/checker/TSAnalyzer.cpp +++ b/ets2panda/checker/TSAnalyzer.cpp @@ -803,9 +803,8 @@ checker::Type *TSAnalyzer::Check(ir::TSModuleBlock *st) const UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSModuleDeclaration *st) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSModuleDeclaration *st) const { - (void)st; UNREACHABLE(); } @@ -845,9 +844,8 @@ checker::Type *TSAnalyzer::Check(ir::TSObjectKeyword *node) const UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSParameterProperty *expr) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSParameterProperty *expr) const { - (void)expr; UNREACHABLE(); } @@ -899,33 +897,28 @@ checker::Type *TSAnalyzer::Check(ir::TSTypeLiteral *node) const UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSTypeOperator *node) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSTypeOperator *node) const { - (void)node; UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSTypeParameter *expr) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSTypeParameter *expr) const { - (void)expr; UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSTypeParameterDeclaration *expr) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSTypeParameterDeclaration *expr) const { - (void)expr; UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSTypeParameterInstantiation *expr) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSTypeParameterInstantiation *expr) const { - (void)expr; UNREACHABLE(); } -checker::Type *TSAnalyzer::Check(ir::TSTypePredicate *node) const +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSTypePredicate *node) const { - (void)node; UNREACHABLE(); } diff --git a/ets2panda/compiler/core/ETSCompiler.cpp b/ets2panda/compiler/core/ETSCompiler.cpp index 46dd096ae82d9c812db8af28704dee330951bdcd..c2f13fbdebeeb237c92e8d34d11b1ada915b5170 100644 --- a/ets2panda/compiler/core/ETSCompiler.cpp +++ b/ets2panda/compiler/core/ETSCompiler.cpp @@ -816,9 +816,8 @@ void ETSCompiler::Compile(const ir::TSModuleBlock *st) const UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSModuleDeclaration *st) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSModuleDeclaration *st) const { - (void)st; UNREACHABLE(); } @@ -858,9 +857,8 @@ void ETSCompiler::Compile(const ir::TSObjectKeyword *node) const UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSParameterProperty *expr) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSParameterProperty *expr) const { - (void)expr; UNREACHABLE(); } @@ -912,33 +910,28 @@ void ETSCompiler::Compile(const ir::TSTypeLiteral *node) const UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSTypeOperator *node) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSTypeOperator *node) const { - (void)node; UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSTypeParameter *expr) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSTypeParameter *expr) const { - (void)expr; UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSTypeParameterDeclaration *expr) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSTypeParameterDeclaration *expr) const { - (void)expr; UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSTypeParameterInstantiation *expr) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSTypeParameterInstantiation *expr) const { - (void)expr; UNREACHABLE(); } -void ETSCompiler::Compile(const ir::TSTypePredicate *node) const +void ETSCompiler::Compile([[maybe_unused]] const ir::TSTypePredicate *node) const { - (void)node; UNREACHABLE(); } diff --git a/ets2panda/compiler/core/JSCompiler.cpp b/ets2panda/compiler/core/JSCompiler.cpp index 10a894d364243fe8b74d0bd55d96c5d90df2551c..b794fb17049b19e3c044cde1febbefca37b22a1a 100644 --- a/ets2panda/compiler/core/JSCompiler.cpp +++ b/ets2panda/compiler/core/JSCompiler.cpp @@ -1101,9 +1101,8 @@ void JSCompiler::Compile(const ir::TSModuleBlock *st) const UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSModuleDeclaration *st) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSModuleDeclaration *st) const { - (void)st; UNREACHABLE(); } @@ -1143,9 +1142,8 @@ void JSCompiler::Compile(const ir::TSObjectKeyword *node) const UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSParameterProperty *expr) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSParameterProperty *expr) const { - (void)expr; UNREACHABLE(); } @@ -1197,33 +1195,28 @@ void JSCompiler::Compile(const ir::TSTypeLiteral *node) const UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSTypeOperator *node) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSTypeOperator *node) const { - (void)node; UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSTypeParameter *expr) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSTypeParameter *expr) const { - (void)expr; UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSTypeParameterDeclaration *expr) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSTypeParameterDeclaration *expr) const { - (void)expr; UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSTypeParameterInstantiation *expr) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSTypeParameterInstantiation *expr) const { - (void)expr; UNREACHABLE(); } -void JSCompiler::Compile(const ir::TSTypePredicate *node) const +void JSCompiler::Compile([[maybe_unused]] const ir::TSTypePredicate *node) const { - (void)node; UNREACHABLE(); } diff --git a/ets2panda/ir/ts/tsModuleDeclaration.cpp b/ets2panda/ir/ts/tsModuleDeclaration.cpp index bc8abb3a0cf3d338c3934fd73af2b133fbeadaa1..25ad9e6570e9bdf2044c4983f8fc51e3772b035a 100644 --- a/ets2panda/ir/ts/tsModuleDeclaration.cpp +++ b/ets2panda/ir/ts/tsModuleDeclaration.cpp @@ -16,6 +16,9 @@ #include "tsModuleDeclaration.h" #include "varbinder/scope.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" #include "ir/base/decorator.h" #include "ir/expression.h" @@ -57,15 +60,23 @@ void TSModuleDeclaration::Dump(ir::AstDumper *dumper) const {"global", global_}}); } -void TSModuleDeclaration::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSModuleDeclaration::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} + +void TSModuleDeclaration::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSModuleDeclaration::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSModuleDeclaration::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsModuleDeclaration.h b/ets2panda/ir/ts/tsModuleDeclaration.h index e8f28c207fb66db398e1ccccea8005bf81ebf4a1..cc3aafc1146d8d301a28c0aa7272fd72da1b117f 100644 --- a/ets2panda/ir/ts/tsModuleDeclaration.h +++ b/ets2panda/ir/ts/tsModuleDeclaration.h @@ -80,6 +80,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override; diff --git a/ets2panda/ir/ts/tsParameterProperty.cpp b/ets2panda/ir/ts/tsParameterProperty.cpp index d42b520c35bcbcce4200beb3a392c9d0b8cffed7..4f5cfd854a5e5408b0c0818b0562a41264efac1b 100644 --- a/ets2panda/ir/ts/tsParameterProperty.cpp +++ b/ets2panda/ir/ts/tsParameterProperty.cpp @@ -15,6 +15,9 @@ #include "tsParameterProperty.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" #include "ir/expression.h" @@ -42,15 +45,22 @@ void TSParameterProperty::Dump(ir::AstDumper *dumper) const {"parameter", parameter_}}); } -void TSParameterProperty::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSParameterProperty::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} +void TSParameterProperty::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSParameterProperty::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSParameterProperty::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsParameterProperty.h b/ets2panda/ir/ts/tsParameterProperty.h index 77b8fbb8321e61d3824d74d26d9521ba27fa5673..f11529dac3c418c46069a5d826f99da6177a1509 100644 --- a/ets2panda/ir/ts/tsParameterProperty.h +++ b/ets2panda/ir/ts/tsParameterProperty.h @@ -64,6 +64,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override; diff --git a/ets2panda/ir/ts/tsTypeOperator.cpp b/ets2panda/ir/ts/tsTypeOperator.cpp index 538bb29e5c1e02f67009fb9c7d39246f824e347f..f945f6e43f3fccbac777ed96d7198f5d44a2dcb4 100644 --- a/ets2panda/ir/ts/tsTypeOperator.cpp +++ b/ets2panda/ir/ts/tsTypeOperator.cpp @@ -15,6 +15,9 @@ #include "tsTypeOperator.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" namespace panda::es2panda::ir { @@ -37,11 +40,18 @@ void TSTypeOperator::Dump(ir::AstDumper *dumper) const }); } -void TSTypeOperator::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSTypeOperator::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} +void TSTypeOperator::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSTypeOperator::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSTypeOperator::GetType([[maybe_unused]] checker::TSChecker *checker) @@ -51,6 +61,6 @@ checker::Type *TSTypeOperator::GetType([[maybe_unused]] checker::TSChecker *chec checker::Type *TSTypeOperator::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsTypeOperator.h b/ets2panda/ir/ts/tsTypeOperator.h index ea2b54e731bcedf5eefd34db174e0d33e1627385..dd09a880341d3d93ae3db690396d04bacfff260b 100644 --- a/ets2panda/ir/ts/tsTypeOperator.h +++ b/ets2panda/ir/ts/tsTypeOperator.h @@ -50,6 +50,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *GetType([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override; diff --git a/ets2panda/ir/ts/tsTypeParameter.cpp b/ets2panda/ir/ts/tsTypeParameter.cpp index 3a92543a40cdfb2247589e3c2c787e35e15d31da..e464990af26f8ebd0bad98179ed160704bc00e1f 100644 --- a/ets2panda/ir/ts/tsTypeParameter.cpp +++ b/ets2panda/ir/ts/tsTypeParameter.cpp @@ -15,6 +15,9 @@ #include "tsTypeParameter.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" #include "ir/typeNode.h" #include "ir/expressions/identifier.h" @@ -58,15 +61,22 @@ void TSTypeParameter::Dump(ir::AstDumper *dumper) const }); } -void TSTypeParameter::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSTypeParameter::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} +void TSTypeParameter::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSTypeParameter::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSTypeParameter::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsTypeParameter.h b/ets2panda/ir/ts/tsTypeParameter.h index aaf9227a7bde0c896f7e7baae133907c323bcc35..09f485eb512eef001625299760290f4dcbb83d47 100644 --- a/ets2panda/ir/ts/tsTypeParameter.h +++ b/ets2panda/ir/ts/tsTypeParameter.h @@ -61,6 +61,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override; diff --git a/ets2panda/ir/ts/tsTypeParameterDeclaration.cpp b/ets2panda/ir/ts/tsTypeParameterDeclaration.cpp index a84b6d16cb7a6a8f6c21be72ea6df82aad1978aa..128f2abae2068a644352b0db973d26b3e4956116 100644 --- a/ets2panda/ir/ts/tsTypeParameterDeclaration.cpp +++ b/ets2panda/ir/ts/tsTypeParameterDeclaration.cpp @@ -16,6 +16,9 @@ #include "tsTypeParameterDeclaration.h" #include "varbinder/scope.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" #include "ir/ts/tsTypeParameter.h" @@ -39,15 +42,22 @@ void TSTypeParameterDeclaration::Dump(ir::AstDumper *dumper) const dumper->Add({{"type", "TSTypeParameterDeclaration"}, {"params", params_}}); } -void TSTypeParameterDeclaration::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSTypeParameterDeclaration::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} +void TSTypeParameterDeclaration::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSTypeParameterDeclaration::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSTypeParameterDeclaration::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsTypeParameterDeclaration.h b/ets2panda/ir/ts/tsTypeParameterDeclaration.h index 6e203679adc7e041816cf6af1c97fc13b9de56f3..8da7d35aebab42149fcb6e21340541f964882ac0 100644 --- a/ets2panda/ir/ts/tsTypeParameterDeclaration.h +++ b/ets2panda/ir/ts/tsTypeParameterDeclaration.h @@ -57,6 +57,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override; diff --git a/ets2panda/ir/ts/tsTypeParameterInstantiation.cpp b/ets2panda/ir/ts/tsTypeParameterInstantiation.cpp index 614e9798df1fab0d259a248af6eb144a817379d9..7b604b1540e7e086b2c46ce5f4589cfe3872c7db 100644 --- a/ets2panda/ir/ts/tsTypeParameterInstantiation.cpp +++ b/ets2panda/ir/ts/tsTypeParameterInstantiation.cpp @@ -16,6 +16,9 @@ #include "es2panda.h" #include "tsTypeParameterInstantiation.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" #include "ir/expression.h" #include "ir/typeNode.h" @@ -62,16 +65,23 @@ void TSTypeParameterInstantiation::Dump(ir::AstDumper *dumper) const dumper->Add({{"type", "TSTypeParameterInstantiation"}, {"params", params_}}); } -void TSTypeParameterInstantiation::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSTypeParameterInstantiation::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} +void TSTypeParameterInstantiation::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSTypeParameterInstantiation::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSTypeParameterInstantiation::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsTypeParameterInstantiation.h b/ets2panda/ir/ts/tsTypeParameterInstantiation.h index 727e08911e51a4b2b7e2b7195e298efe543c6f08..0ce61df1c3b65fe03bebf70dfddaa55f6d576299 100644 --- a/ets2panda/ir/ts/tsTypeParameterInstantiation.h +++ b/ets2panda/ir/ts/tsTypeParameterInstantiation.h @@ -49,6 +49,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override; diff --git a/ets2panda/ir/ts/tsTypePredicate.cpp b/ets2panda/ir/ts/tsTypePredicate.cpp index 9e12cb8569dbd93034dcad3b9e919de7a3df937c..16c99b8747da8bd8615dc326242b48f93af2ba9a 100644 --- a/ets2panda/ir/ts/tsTypePredicate.cpp +++ b/ets2panda/ir/ts/tsTypePredicate.cpp @@ -15,6 +15,9 @@ #include "tsTypePredicate.h" +#include "checker/TSchecker.h" +#include "compiler/core/ETSGen.h" +#include "compiler/core/pandagen.h" #include "ir/astDump.h" #include "ir/typeNode.h" #include "ir/expression.h" @@ -44,11 +47,18 @@ void TSTypePredicate::Dump(ir::AstDumper *dumper) const {"asserts", asserts_}}); } -void TSTypePredicate::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} +void TSTypePredicate::Compile([[maybe_unused]] compiler::PandaGen *pg) const +{ + pg->GetAstCompiler()->Compile(this); +} +void TSTypePredicate::Compile(compiler::ETSGen *etsg) const +{ + etsg->GetAstCompiler()->Compile(this); +} checker::Type *TSTypePredicate::Check([[maybe_unused]] checker::TSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } checker::Type *TSTypePredicate::GetType([[maybe_unused]] checker::TSChecker *checker) @@ -58,6 +68,6 @@ checker::Type *TSTypePredicate::GetType([[maybe_unused]] checker::TSChecker *che checker::Type *TSTypePredicate::Check([[maybe_unused]] checker::ETSChecker *checker) { - return nullptr; + return checker->GetAnalyzer()->Check(this); } } // namespace panda::es2panda::ir diff --git a/ets2panda/ir/ts/tsTypePredicate.h b/ets2panda/ir/ts/tsTypePredicate.h index e32610b702250e528746ac92b77bfc86facdc6d8..f19587cf064675abc5b461eff41ae3ab1d2d2077 100644 --- a/ets2panda/ir/ts/tsTypePredicate.h +++ b/ets2panda/ir/ts/tsTypePredicate.h @@ -48,6 +48,7 @@ public: void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + void Compile(compiler::ETSGen *etsg) const override; checker::Type *Check([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *GetType([[maybe_unused]] checker::TSChecker *checker) override; checker::Type *Check([[maybe_unused]] checker::ETSChecker *checker) override;