Skip to content

Commit eb69afc

Browse files
authored
[SIL] Fix printing of type erased layout constraints (swiftlang#63561)
When type erased, the constraint should be printed as the layout name (e.g. `_Class` and not `AnyObject`).
1 parent 64ba69e commit eb69afc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/SIL/IR/SILPrinter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4096,7 +4096,9 @@ void SILSpecializeAttr::print(llvm::raw_ostream &OS) const {
40964096
} else {
40974097
Requirement ReqWithDecls(req.getKind(), FirstTy,
40984098
req.getLayoutConstraint());
4099-
ReqWithDecls.print(OS, SubPrinter);
4099+
auto SubPrinterCopy = SubPrinter;
4100+
SubPrinterCopy.PrintClassLayoutName = erased;
4101+
ReqWithDecls.print(OS, SubPrinterCopy);
41004102
}
41014103
},
41024104
[&] { OS << ", "; });

0 commit comments

Comments
 (0)