mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Distinguish conformance and superclass generic requirements.
As part of this, use a different enum for parsed generic requirements. NFC except that I noticed that ASTWalker wasn't visiting the second type in a conformance constraint; fixing this seems to have no effect beyond producing better IDE annotations.
This commit is contained in:
@@ -921,6 +921,7 @@ static uint8_t getRawStableRequirementKind(RequirementKind kind) {
|
||||
|
||||
switch (kind) {
|
||||
CASE(Conformance)
|
||||
CASE(Superclass)
|
||||
CASE(SameType)
|
||||
CASE(WitnessMarker)
|
||||
}
|
||||
@@ -973,7 +974,7 @@ bool Serializer::writeGenericParams(const GenericParamList *genericParams,
|
||||
llvm::raw_svector_ostream ReqOS(ReqStr);
|
||||
next.printAsWritten(ReqOS);
|
||||
switch (next.getKind()) {
|
||||
case RequirementKind::Conformance:
|
||||
case RequirementReprKind::TypeConstraint:
|
||||
GenericRequirementLayout::emitRecord(
|
||||
Out, ScratchRecord, abbrCode,
|
||||
GenericRequirementKind::Conformance,
|
||||
@@ -981,7 +982,7 @@ bool Serializer::writeGenericParams(const GenericParamList *genericParams,
|
||||
addTypeRef(next.getConstraint()),
|
||||
ReqOS.str());
|
||||
break;
|
||||
case RequirementKind::SameType:
|
||||
case RequirementReprKind::SameType:
|
||||
GenericRequirementLayout::emitRecord(
|
||||
Out, ScratchRecord, abbrCode,
|
||||
GenericRequirementKind::SameType,
|
||||
@@ -989,9 +990,6 @@ bool Serializer::writeGenericParams(const GenericParamList *genericParams,
|
||||
addTypeRef(next.getSecondType()),
|
||||
ReqOS.str());
|
||||
break;
|
||||
case RequirementKind::WitnessMarker:
|
||||
llvm_unreachable("Can't show up in requirement representations");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user