Skip to content

Commit 74b6535

Browse files
committed
Lift GenericSignature::hasTypeVariable
1 parent a0615e9 commit 74b6535

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/swift/AST/GenericSignature.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ class GenericSignature {
195195

196196
/// Retrieve the requirements.
197197
ArrayRef<Requirement> getRequirements() const;
198+
199+
/// Whether this generic signature involves a type variable.
200+
bool hasTypeVariable() const;
198201
};
199202

200203
/// A reference to a canonical generic signature.
@@ -424,9 +427,6 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
424427
/// generic parameter types by their sugared form.
425428
Type getSugaredType(Type type) const;
426429

427-
/// Whether this generic signature involves a type variable.
428-
bool hasTypeVariable() const;
429-
430430
static void Profile(llvm::FoldingSetNodeID &ID,
431431
TypeArrayView<GenericTypeParamType> genericParams,
432432
ArrayRef<Requirement> requirements);

lib/AST/ASTContext.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,8 +1775,8 @@ static AllocationArena getArena(GenericSignature genericSig) {
17751775
if (!genericSig)
17761776
return AllocationArena::Permanent;
17771777

1778-
if (genericSig->hasTypeVariable()) {
1779-
assert(false && "What's going on");
1778+
if (genericSig.hasTypeVariable()) {
1779+
assert(false && "Unsubstituted type variable leaked into generic signature");
17801780
return AllocationArena::ConstraintSolver;
17811781
}
17821782

lib/AST/GenericSignature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ unsigned GenericSignatureImpl::getGenericParamOrdinal(
12721272
return GenericParamKey(param).findIndexIn(getGenericParams());
12731273
}
12741274

1275-
bool GenericSignatureImpl::hasTypeVariable() const {
1275+
bool GenericSignature::hasTypeVariable() const {
12761276
return GenericSignature::hasTypeVariable(getRequirements());
12771277
}
12781278

0 commit comments

Comments
 (0)