diff --git a/AK/Variant.h b/AK/Variant.h index ede7a3dd541..83c884d3494 100644 --- a/AK/Variant.h +++ b/AK/Variant.h @@ -319,7 +319,7 @@ public: } template - Variant verify_cast() && + Variant downcast() && { Variant instance { Variant::invalid_index, Detail::VariantConstructTag {} }; visit([&](auto& value) { @@ -331,7 +331,7 @@ public: } template - Variant verify_cast() & + Variant downcast() & { Variant instance { Variant::invalid_index, Detail::VariantConstructTag {} }; visit([&](const auto& value) { diff --git a/Tests/AK/TestVariant.cpp b/Tests/AK/TestVariant.cpp index 2c1b0c725ff..4825c6bb0a2 100644 --- a/Tests/AK/TestVariant.cpp +++ b/Tests/AK/TestVariant.cpp @@ -80,14 +80,14 @@ TEST_CASE(move_moves) TEST_CASE(verify_cast) { Variant one_integer_to_rule_them_all { static_cast(42) }; - auto fake_integer = one_integer_to_rule_them_all.verify_cast(); + auto fake_integer = one_integer_to_rule_them_all.downcast(); EXPECT(fake_integer.has()); EXPECT(one_integer_to_rule_them_all.has()); EXPECT_EQ(fake_integer.get(), 42); EXPECT_EQ(one_integer_to_rule_them_all.get(), 42); fake_integer = static_cast(60); - one_integer_to_rule_them_all = fake_integer.verify_cast().verify_cast().verify_cast(); + one_integer_to_rule_them_all = fake_integer.downcast().downcast().downcast(); EXPECT(fake_integer.has()); EXPECT(one_integer_to_rule_them_all.has()); EXPECT_EQ(fake_integer.get(), 60); diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index d0b0ba7ac0d..e1f9671c289 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -1691,7 +1691,7 @@ NonnullRefPtr Parser::parse_variable_declaration(bool for_l declarations.append(create_ast_node( { m_state.current_token.filename(), rule_start.position(), position() }, - move(target).verify_cast, NonnullRefPtr>(), + move(target).downcast, NonnullRefPtr>(), move(init))); if (match(TokenType::Comma)) { diff --git a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp index a75590515cb..49580e31b15 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/AbstractMachine.cpp @@ -397,7 +397,7 @@ Optional AbstractMachine::allocate_all_initial_phase(Module module_instance.exports().append(ExportInstance { entry.name(), - move(address).verify_cast(), + move(address).downcast(), }); } });