File tree Expand file tree Collapse file tree 4 files changed +17
-16
lines changed Expand file tree Collapse file tree 4 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -5567,15 +5567,6 @@ class OpaqueTypeArchetypeType final : public ArchetypeType,
5567
5567
return T->getKind () == TypeKind::OpaqueTypeArchetype;
5568
5568
}
5569
5569
5570
- // / Get the ordinal of the type within the declaration's opaque signature.
5571
- // /
5572
- // / If a method declared its return type as:
5573
- // /
5574
- // / func foo() -> (some P, some Q)
5575
- // /
5576
- // / then the underlying type of `some P` would be ordinal 0, and `some Q` would be ordinal 1.
5577
- unsigned getOrdinal () const ;
5578
-
5579
5570
private:
5580
5571
OpaqueTypeArchetypeType (GenericEnvironment *environment,
5581
5572
RecursiveTypeProperties properties,
Original file line number Diff line number Diff line change @@ -3722,6 +3722,7 @@ namespace {
3722
3722
StringRef label) {
3723
3723
printCommon (label, className);
3724
3724
printField (" address" , static_cast <void *>(T));
3725
+ printRec (" interface_type" , T->getInterfaceType ());
3725
3726
printFlag (T->requiresClass (), " class" );
3726
3727
if (auto layout = T->getLayoutConstraint ()) {
3727
3728
OS << " layout=" ;
@@ -3731,6 +3732,7 @@ namespace {
3731
3732
printField (" conforms_to" , proto->printRef ());
3732
3733
if (auto superclass = T->getSuperclass ())
3733
3734
printRec (" superclass" , superclass);
3735
+
3734
3736
}
3735
3737
3736
3738
void visitPrimaryArchetypeType (PrimaryArchetypeType *T, StringRef label) {
@@ -3755,7 +3757,6 @@ namespace {
3755
3757
StringRef label) {
3756
3758
printArchetypeCommon (T, " opaque_type" , label);
3757
3759
printField (" decl" , T->getDecl ()->getNamingDecl ()->printRef ());
3758
- printField (" ordinal" , T->getOrdinal ());
3759
3760
if (!T->getSubstitutions ().empty ()) {
3760
3761
OS << ' \n ' ;
3761
3762
SmallPtrSet<const ProtocolConformance *, 4 > Dumped;
Original file line number Diff line number Diff line change @@ -5893,6 +5893,12 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
5893
5893
}
5894
5894
5895
5895
void visitOpenedArchetypeType (OpenedArchetypeType *T) {
5896
+ if (auto parent = T->getParent ()) {
5897
+ visitParentType (parent);
5898
+ printArchetypeCommon (T, getAbstractTypeParamDecl (T));
5899
+ return ;
5900
+ }
5901
+
5896
5902
if (Options.PrintForSIL )
5897
5903
Printer << " @opened(\" " << T->getOpenedExistentialID () << " \" ) " ;
5898
5904
visit (T->getOpenedExistentialType ());
@@ -5940,10 +5946,17 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
5940
5946
}
5941
5947
5942
5948
void visitOpaqueTypeArchetypeType (OpaqueTypeArchetypeType *T) {
5949
+ if (auto parent = T->getParent ()) {
5950
+ visitParentType (parent);
5951
+ printArchetypeCommon (T, getAbstractTypeParamDecl (T));
5952
+ return ;
5953
+ }
5954
+
5943
5955
// Try to print a named opaque type.
5944
5956
auto printNamedOpaque = [&] {
5945
- if (auto genericParam =
5946
- T->getDecl ()->getExplicitGenericParam (T->getOrdinal ())) {
5957
+ unsigned ordinal =
5958
+ T->getInterfaceType ()->castTo <GenericTypeParamType>()->getIndex ();
5959
+ if (auto genericParam = T->getDecl ()->getExplicitGenericParam (ordinal)) {
5947
5960
visit (genericParam->getDeclaredInterfaceType ());
5948
5961
return true ;
5949
5962
}
Original file line number Diff line number Diff line change @@ -3302,10 +3302,6 @@ OpaqueTypeArchetypeType::OpaqueTypeArchetypeType(
3302
3302
{
3303
3303
}
3304
3304
3305
- unsigned OpaqueTypeArchetypeType::getOrdinal () const {
3306
- return getInterfaceType ()->castTo <GenericTypeParamType>()->getIndex ();
3307
- }
3308
-
3309
3305
SequenceArchetypeType::SequenceArchetypeType (
3310
3306
const ASTContext &Ctx, GenericEnvironment *GenericEnv, Type InterfaceType,
3311
3307
ArrayRef<ProtocolDecl *> ConformsTo, Type Superclass,
You can’t perform that action at this time.
0 commit comments