Even if the selector expression has an error, we can resolve the
associate-name.
Original-commit: flang-compiler/f18@
3c35c30f581b2ef0d7d74af8fddfc4adaba9d6c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false
}
void ConstructVisitor::Post(const parser::SelectTypeStmt &x) {
- if (!association_.expr) {
- return; // reported error in expression evaluation
- }
if (const std::optional<parser::Name> &name{std::get<1>(x.t)}) {
// This isn't a name in the current scope, it is in each TypeGuardStmt
MakePlaceholder(*name, MiscDetails::Kind::SelectTypeAssociateName);
} else if (!association_.variable) {
Say("Selector is not a named variable: 'associate-name =>' is required"_err_en_US);
association_ = {};
- return;
}
}