File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -467,16 +467,7 @@ CanType GenericSignatureImpl::getCanonicalTypeInContext(Type type) const {
467
467
}
468
468
469
469
bool GenericSignatureImpl::isValidTypeInContext (Type type) const {
470
- auto &ctx = getASTContext ();
471
- switch (ctx.LangOpts .EnableRequirementMachine ) {
472
- case RequirementMachineMode::Disabled:
473
- llvm::errs () << " Not implemented\n " ;
474
- abort ();
475
-
476
- case RequirementMachineMode::Enabled:
477
- case RequirementMachineMode::Verify:
478
- return getRequirementMachine ()->isValidTypeInContext (type);
479
- }
470
+ return getRequirementMachine ()->isValidTypeInContext (type);
480
471
}
481
472
482
473
ArrayRef<CanTypeWrapper<GenericTypeParamType>>
Original file line number Diff line number Diff line change @@ -3703,10 +3703,12 @@ Type ArchetypeType::getNestedType(AssociatedTypeDecl *assocType) {
3703
3703
}
3704
3704
3705
3705
Type ArchetypeType::getNestedTypeByName (Identifier name) {
3706
- auto memberDecl = getGenericEnvironment ()->getGenericSignature ()
3707
- ->lookupNestedType (getInterfaceType (), name);
3708
- if (auto assocType = dyn_cast_or_null<AssociatedTypeDecl>(memberDecl)) {
3709
- return getNestedType (assocType);
3706
+ Type interfaceType = getInterfaceType ();
3707
+ Type memberInterfaceType = DependentMemberType::get (interfaceType, name);
3708
+ auto genericSig = getGenericEnvironment ()->getGenericSignature ();
3709
+ if (genericSig->isValidTypeInContext (memberInterfaceType)) {
3710
+ return getGenericEnvironment ()->getOrCreateArchetypeFromInterfaceType (
3711
+ memberInterfaceType);
3710
3712
}
3711
3713
3712
3714
return Type ();
You can’t perform that action at this time.
0 commit comments