Skip to content

Commit a4cccaf

Browse files
committed
ASTMangler: Fix mangling of invalid dependent member types
Fixes <rdar://problem/48014983>.
1 parent d0c7b15 commit a4cccaf

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,8 @@ void ASTMangler::appendType(Type type) {
961961
// Dependent members of non-generic-param types are not canonical, but
962962
// we may still want to mangle them for debugging or indexing purposes.
963963
appendType(DepTy->getBase());
964-
appendAssociatedTypeName(DepTy);
965-
appendOperator("qa");
964+
appendIdentifier(DepTy->getName().str());
965+
appendOperator("Qa");
966966
}
967967
addTypeSubstitution(DepTy);
968968
return;

test/Index/invalid_code.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ class CrashTest2 {
3030
}
3131
}
3232
}
33+
34+
public struct BadCollection: Collection {
35+
public var startIndex: Index { }
36+
public var endIndex: Index { }
37+
public func index(after index: Index) -> Index { }
38+
public subscript(position: Index) -> Element { }
39+
}

0 commit comments

Comments
 (0)