Skip to content

Commit 07d08b6

Browse files
committed
Demangler: Fix printing of constrained existential types
We never updated the mangling tree to model existential types, and NodePrinter still prints 'any P.Type' as 'P.Type' and '(any P).Type' as 'P.Protocol'. However, constrained existentials always printed as 'any P', unfortunately isSimpleType() returned true and isExistentialType() returned false, so 'any (P<Int>.Type)' and '(any P<Int>).Type' both printed as 'any P<Int>.Type'. Changing isSimpleType() to return false fixes this; now we print 'any (P<Int>.Type)' as 'any P<Int>.Type' and '(any P<Int>).Type' as '(any P<Int>).Type'.
1 parent 6bc2082 commit 07d08b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Demangling/NodePrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ class NodePrinter {
310310
case Node::Kind::Pack:
311311
case Node::Kind::SILPackDirect:
312312
case Node::Kind::SILPackIndirect:
313-
case Node::Kind::ConstrainedExistential:
314313
case Node::Kind::ConstrainedExistentialRequirementList:
315314
case Node::Kind::ConstrainedExistentialSelf:
316315
case Node::Kind::Protocol:
@@ -340,6 +339,7 @@ class NodePrinter {
340339
case Node::Kind::ProtocolListWithAnyObject:
341340
return Node->getChild(0)->getChild(0)->getNumChildren() == 0;
342341

342+
case Node::Kind::ConstrainedExistential:
343343
case Node::Kind::PackExpansion:
344344
case Node::Kind::ProtocolListWithClass:
345345
case Node::Kind::AccessorAttachedMacroExpansion:

0 commit comments

Comments
 (0)