Skip to content

Commit 25f3b3d

Browse files
committed
[GSB] Remove unused "from generic typealias" hack.
1 parent 9e9a0a0 commit 25f3b3d

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,7 @@ class GenericSignatureBuilder {
549549
///
550550
/// This returns either a non-typealias potential archetype or a Type, if \c
551551
/// type is concrete.
552-
// FIXME: the hackTypeFromGenericTypeAlias is just temporarily patching over
553-
// problems with generic typealiases (see the comment on the ResolvedType
554-
// function)
555-
ResolvedType resolve(UnresolvedType type,
556-
bool hackTypeFromGenericTypeAlias = false);
552+
ResolvedType resolve(UnresolvedType type);
557553

558554
/// \brief Dump all of the requirements, both specified and inferred.
559555
LLVM_ATTRIBUTE_DEPRECATED(

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,14 +1004,6 @@ struct GenericSignatureBuilder::ResolvedType {
10041004
return ResolvedType(t);
10051005
}
10061006

1007-
// FIXME: this probably shouldn't exist, the potential archetype modelling of
1008-
// generic typealiases is fundamentally broken (aka they're not modelled at
1009-
// all), but some things with them mostly work, so we just maintain that,
1010-
// despite this causing crashes and weird behavior.
1011-
static ResolvedType forConcreteTypeFromGenericTypeAlias(Type t) {
1012-
return ResolvedType(t);
1013-
}
1014-
10151007
static ResolvedType forPotentialArchetype(PotentialArchetype *pa) {
10161008
return ResolvedType(pa);
10171009
}
@@ -2027,15 +2019,12 @@ auto GenericSignatureBuilder::resolveArchetype(Type type) -> PotentialArchetype
20272019
return nullptr;
20282020
}
20292021

2030-
auto GenericSignatureBuilder::resolve(UnresolvedType paOrT,
2031-
bool hackTypeFromGenericTypeAlias)
2022+
auto GenericSignatureBuilder::resolve(UnresolvedType paOrT)
20322023
-> ResolvedType {
20332024
auto pa = paOrT.dyn_cast<PotentialArchetype *>();
20342025
if (auto type = paOrT.dyn_cast<Type>()) {
20352026
pa = resolveArchetype(type);
20362027
if (!pa) {
2037-
if (hackTypeFromGenericTypeAlias)
2038-
return ResolvedType::forConcreteTypeFromGenericTypeAlias(type);
20392028
return ResolvedType::forConcreteType(type);
20402029
}
20412030
}

0 commit comments

Comments
 (0)