Feature generic choice (#2042)

Implementation of generic choices!

I hope it is useful!
This commit is contained in:
pmqtt
2022-08-24 11:30:04 -07:00
committed by GitHub
parent 499188bfcf
commit f957d4d87d
10 changed files with 225 additions and 17 deletions
+2 -1
View File
@@ -937,7 +937,8 @@ auto ConstraintType::VisitEqualValues(
auto ChoiceType::FindAlternative(std::string_view name) const
-> std::optional<Nonnull<const Value*>> {
for (const NamedValue& alternative : alternatives_) {
std::vector<NamedValue> alternatives = declaration_->members();
for (const NamedValue& alternative : alternatives) {
if (alternative.name == name) {
return alternative.value;
}