mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SE-0095] [Runtime], [Demangler], & AST printer updated to new composition syntax
- All parts of the compiler now use ‘P1 & P2’ syntax
- The demangler and AST printer wrap the composition in parens if it is
in a metatype lookup
- IRGen mangles compositions differently
- “protocol<>” is now “swift.Any”
- “protocol<_TP1P,_TP1Q>” is now “_TP1P&_TP1Q”
- Tests cases are updated and added to test the new syntax and mangling
This commit is contained in:
@@ -3465,12 +3465,10 @@ void NodePrinter::print(NodePointer pointer, bool asContext, bool suppressType)
|
||||
NodePointer type_list = pointer->getChild(0);
|
||||
if (!type_list)
|
||||
return;
|
||||
bool needs_proto_marker = (type_list->getNumChildren() != 1);
|
||||
if (needs_proto_marker)
|
||||
Printer << "protocol<";
|
||||
printChildren(type_list, ", ");
|
||||
if (needs_proto_marker)
|
||||
Printer << ">";
|
||||
if (type_list->getNumChildren() == 0)
|
||||
Printer << "Any";
|
||||
else
|
||||
printChildren(type_list, " & ");
|
||||
return;
|
||||
}
|
||||
case Node::Kind::Archetype: {
|
||||
|
||||
Reference in New Issue
Block a user