ViperMcFlurry的不兼容块指针类型发送'id问题

问题描述

多年以来,我一直在项目中使用ViperMcFlurry且没有问题,而使用XCode 12 beta 6时,它返回Incompatible block pointer types sending错误。我尝试了各种方法来修复它,但是没有机会。它返回

Incompatible block pointer types sending 'id<RamblerViperModuleOutput> (^)(__strong id<RamblerModuleBetaInput>)' to parameter of type 'RamblerViperModuleLinkBlock' (aka 'id<RamblerViperModuleOutput> (^)(__strong id<RamblerViperModuleInput>)')

我想做的是

[[self.transitionHandler openModuleUsingSegue:RamblerAlphaToBetaSegue]
 thenChainUsingBlock:^id<RamblerViperModuleOutput>(id<RamblerModuleBetaInput> moduleInput) {
     [moduleInput configureWithExampleString:exampleString];
     return nil;
 }];

我有

@protocol RamblerModuleBetaInput <RamblerViperModuleInput>
RamblerModuleBetaInput.h

。我也有

@protocol RamblerViperModuleInput <NSObject>

RamblerViperModuleInput.h

解决方法

请参阅https://github.com/rambler-digital-solutions/ViperMcFlurry/pull/37,或者暂时可以通过在构建设置CFLAGS中添加标记来禁用检查-Xclang -fcompatibility-qualified-id-block-type-checking来解决此问题。