mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Feature generic choice (#2042)
Implementation of generic choices! I hope it is useful!
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user