File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1842,22 +1842,29 @@ class GenericSignatureBuilder::InferRequirementsWalker : public TypeWalker {
1842
1842
if (isOuterArchetype (subjectPA))
1843
1843
return Action::Continue;
1844
1844
1845
- if (req->getKind () == RequirementKind::Conformance) {
1845
+ switch (req->getKind ()) {
1846
+ case RequirementKind::Conformance: {
1846
1847
auto proto = req->getSecondType ()->castTo <ProtocolType>();
1847
1848
if (Builder.addConformanceRequirement (subjectPA, proto->getDecl (),
1848
1849
source)) {
1849
1850
return Action::Stop;
1850
1851
}
1851
- } else if (req->getKind () == RequirementKind::Layout) {
1852
+ break ;
1853
+ }
1854
+ case RequirementKind::Layout:
1852
1855
if (Builder.addLayoutRequirement (
1853
1856
subjectPA, req->getLayoutConstraint (), source)) {
1854
1857
return Action::Stop;
1855
1858
}
1856
- } else {
1859
+ break ;
1860
+ case RequirementKind::Superclass:
1857
1861
if (Builder.addSuperclassRequirement (subjectPA, req->getSecondType (),
1858
1862
source)) {
1859
1863
return Action::Stop;
1860
1864
}
1865
+ break ;
1866
+ case RequirementKind::SameType:
1867
+ llvm_unreachable (" covered by outer switch" );
1861
1868
}
1862
1869
break ;
1863
1870
}
You can’t perform that action at this time.
0 commit comments