mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:24:42 +01:00
Fix poor dyn_cast usage (#2763)
Note the dest_class case didn't actually check dyn_cast success until after using the pointer. That's the case I noticed first, but also cleaning up a couple other small related things.
This commit is contained in:
@@ -979,7 +979,7 @@ auto Interpreter::CallFunction(const CallExpression& call,
|
||||
}
|
||||
case Value::Kind::FunctionValue:
|
||||
case Value::Kind::BoundMethodValue: {
|
||||
const auto* func_val = dyn_cast<FunctionOrMethodValue>(fun);
|
||||
const auto* func_val = cast<FunctionOrMethodValue>(fun);
|
||||
|
||||
const FunctionDeclaration& function = func_val->declaration();
|
||||
if (!function.body().has_value()) {
|
||||
|
||||
Reference in New Issue
Block a user