File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -546,11 +546,11 @@ Type ArchetypeBuilder::PotentialArchetype::getTypeInContext(
546
546
547
547
// Local function to check whether we have a generic parameter that has
548
548
// already been recorded
549
- auto getAlreadyRecoveredGenericParam = [&]() -> Optional< Type> {
550
- if (!isGenericParam ()) return None ;
549
+ auto getAlreadyRecoveredGenericParam = [&]() -> Type {
550
+ if (!isGenericParam ()) return Type () ;
551
551
552
552
auto type = genericEnv->getMappingIfPresent (getGenericParamKey ());
553
- if (!type) return None ;
553
+ if (!type) return Type () ;
554
554
555
555
// We already have a mapping for this generic parameter in the generic
556
556
// environment. Return it.
@@ -610,7 +610,7 @@ Type ArchetypeBuilder::PotentialArchetype::getTypeInContext(
610
610
// We will build the archetype below.
611
611
assocType = getResolvedAssociatedType ();
612
612
} else if (auto result = getAlreadyRecoveredGenericParam ()) {
613
- return * result;
613
+ return result;
614
614
}
615
615
616
616
// Determine the superclass for the archetype. If it exists and involves
@@ -627,7 +627,7 @@ Type ArchetypeBuilder::PotentialArchetype::getTypeInContext(
627
627
// We might have recursively recorded the archetype; if so, return early.
628
628
// FIXME: This should be detectable before we end up building archetypes.
629
629
if (auto result = getAlreadyRecoveredGenericParam ())
630
- return * result;
630
+ return result;
631
631
}
632
632
633
633
// Build a new archetype.
Original file line number Diff line number Diff line change @@ -4707,7 +4707,7 @@ namespace {
4707
4707
CanType getParentType () const {
4708
4708
Type type = Target->getDeclaredTypeInContext ();
4709
4709
Type parentType = type->getNominalParent ();
4710
- return parentType ? parentType-> getCanonicalType () : CanType ();
4710
+ return parentType. getCanonicalTypeOrNull ();
4711
4711
}
4712
4712
4713
4713
public:
You can’t perform that action at this time.
0 commit comments