Skip to content

Commit c075bec

Browse files
committed
Revert "AST: Early exit from subst() if the type is concrete"
This reverts commit e653e00. This commit caused SIL verification errors with the "buildbot,tools=RA,stdlib=RD" preset. The root cause is that we're still not consistently setting the recursive properties of the NameAliasType, so the early exit in Type::subst() was falsely taken even when the underlying type of the NameAliasType contained archetypes. The lazy 'mapTypeOutOfContext()' applied to the underlying type complicates matters since we can't know the recursive properties until the alias type has been desugared for the first time. A correct fix is to store the underlying type of a type alias as an interface type, and set the recursive properties right away when the type alias is deserialized; until that's done, reverting this is an adequate workaround. Fixes <rdar://problem/29642870>.
1 parent 9cb2212 commit c075bec

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

lib/AST/Type.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,16 +2907,7 @@ static Type substType(
29072907
llvm::PointerUnion<ModuleDecl *, const SubstitutionMap *> conformances,
29082908
TypeSubstitutionFn substitutions,
29092909
SubstOptions options) {
2910-
2911-
// FIXME: Change getTypeOfMember() to not pass GenericFunctionType here
2912-
if (!derivedType->hasArchetype() &&
2913-
!derivedType->hasTypeParameter() &&
2914-
!derivedType->is<GenericFunctionType>())
2915-
return derivedType;
2916-
29172910
return derivedType.transform([&](Type type) -> Type {
2918-
// FIXME: Add SIL versions of mapTypeIntoContext() and
2919-
// mapTypeOutOfContext() and use them appropriately
29202911
assert((options.contains(SubstFlags::AllowLoweredTypes) ||
29212912
!isa<SILFunctionType>(type.getPointer())) &&
29222913
"should not be doing AST type-substitution on a lowered SIL type;"

0 commit comments

Comments
 (0)