@@ -58,16 +58,6 @@ class GenericRequirement {
58
58
GenericRequirement (Kind kind, CanType type, ProtocolDecl *proto)
59
59
: kind(kind), type(type), proto(proto) {}
60
60
61
- static bool isPack (CanType ty) {
62
- if (auto gp = dyn_cast<GenericTypeParamType>(ty))
63
- return gp->isParameterPack ();
64
- if (auto dm = dyn_cast<DependentMemberType>(ty))
65
- if (auto gp =
66
- dyn_cast<GenericTypeParamType>(dm->getBase ()->getCanonicalType ()))
67
- return gp->isParameterPack ();
68
- return false ;
69
- }
70
-
71
61
public:
72
62
Kind getKind () const {
73
63
return kind;
@@ -91,7 +81,7 @@ class GenericRequirement {
91
81
}
92
82
93
83
bool isMetadata () const {
94
- return kind == Kind::Metadata;
84
+ return kind == Kind::Metadata || kind == Kind::MetadataPack ;
95
85
}
96
86
97
87
static GenericRequirement forMetadata (CanType type, bool isPack) {
@@ -100,11 +90,11 @@ class GenericRequirement {
100
90
}
101
91
102
92
static GenericRequirement forMetadata (CanType type) {
103
- return forMetadata (type, isPack ( type));
93
+ return forMetadata (type, type-> hasParameterPack ( ));
104
94
}
105
95
106
96
bool isWitnessTable () const {
107
- return kind == Kind::WitnessTable;
97
+ return kind == Kind::WitnessTable || kind == Kind::WitnessTablePack ;
108
98
}
109
99
110
100
static GenericRequirement forWitnessTable (CanType type, ProtocolDecl *proto,
@@ -114,7 +104,7 @@ class GenericRequirement {
114
104
}
115
105
116
106
static GenericRequirement forWitnessTable (CanType type, ProtocolDecl *proto) {
117
- return forWitnessTable (type, proto, isPack ( type));
107
+ return forWitnessTable (type, proto, type-> hasParameterPack ( ));
118
108
}
119
109
120
110
static llvm::Type *typeForKind (irgen::IRGenModule &IGM,
0 commit comments