Skip to content

Commit 2a61872

Browse files
committed
Change, use node->as for cast node
1 parent 568e75a commit 2a61872

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/localizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ struct FindRequireConstantString : public Luau::AstVisitor {
3535
std::vector<ExprCallRequire> list;
3636

3737
bool visit(class Luau::AstNode* node) override {
38-
if (Luau::AstExprCall* call_node = dynamic_cast<Luau::AstExprCall*>(node)) {
38+
if (Luau::AstExprCall* call_node = node->as<Luau::AstExprCall>()) {
3939
Luau::AstExpr* func = call_node->func;
4040

41-
if (Luau::AstExprGlobal* func_node = dynamic_cast<Luau::AstExprGlobal*>(func)) {
41+
if (Luau::AstExprGlobal* func_node = func->as<Luau::AstExprGlobal>()) {
4242
if (strncmp(func_node->name.value, "require", 7) == 0) {
4343
Luau::AstExpr* args_0 = call_node->args.data[0];
4444

45-
if (Luau::AstExprConstantString* const_string_node = dynamic_cast<Luau::AstExprConstantString*>(args_0)) {
45+
if (Luau::AstExprConstantString* const_string_node = args_0->as<Luau::AstExprConstantString>()) {
4646
this->list.push_back({"", const_string_node->value.data, Location(call_node->location)});
4747
}
4848
}

0 commit comments

Comments
 (0)