File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,26 @@ class FunctionTypeIsolation {
127
127
return getKind () == Kind::NonIsolatedCaller;
128
128
}
129
129
130
+ // / Two function type isolations are equal if they have the same kind and
131
+ // / (when applicable) the same global actor types.
132
+ // /
133
+ // / Exact equality is the right thing to ask about when deciding whether
134
+ // / two isolations are the same statically, because we have to treat
135
+ // / different specializations of the same generic global actor type
136
+ // / as potentially different isolations. (Of course, you must be comparing
137
+ // / types that have been mapped into the same context.)
138
+ // /
139
+ // / Exact equality is *not* the right thing to ask about when deciding
140
+ // / whether two isolations might be the same dynamically, because two
141
+ // / different specializations of the same generic global actor type
142
+ // / could absolutely end up being the same in concrete specialization.
143
+ bool operator ==(FunctionTypeIsolation other) const {
144
+ return value == other.value ;
145
+ }
146
+ bool operator !=(FunctionTypeIsolation other) const {
147
+ return value != other.value ;
148
+ }
149
+
130
150
// The opaque accessors below are just for the benefit of ExtInfoBuilder,
131
151
// which finds it convenient to break down the type separately. Normal
132
152
// clients should use the accessors above.
Original file line number Diff line number Diff line change @@ -5350,8 +5350,13 @@ SILFunctionType::SILFunctionType(
5350
5350
" Cannot return an @noescape function type" );
5351
5351
}
5352
5352
}
5353
+ bool hasIsolatedParameter = false ; (void ) hasIsolatedParameter;
5353
5354
for (auto param : getParameters ()) {
5354
- (void )param;
5355
+ if (param.hasOption (SILParameterInfo::Isolated)) {
5356
+ assert (!hasIsolatedParameter &&
5357
+ " building SIL function type with multiple isolated parameters" );
5358
+ hasIsolatedParameter = true ;
5359
+ }
5355
5360
assert (!isa<PackExpansionType>(param.getInterfaceType ()) &&
5356
5361
" Cannot have a pack expansion directly as a parameter" );
5357
5362
assert (param.isPack () == isa<SILPackType>(param.getInterfaceType ()) &&
You can’t perform that action at this time.
0 commit comments