weixin_39822493
weixin_39822493
2020-12-06 19:02

Build failure in Xcode 9b4

Three UIKit classes are reported as not conforming to ValidatableInterfaceElement:


/Pods/Validator/Validator/Sources/UIKit+Validator/UISlider+Validator.swift:33:1: error: type 'UISlider' does not conform to protocol 'ValidatableInterfaceElement'
extension UISlider: ValidatableInterfaceElement {
^
/Pods/Validator/Validator/Sources/UIKit+Validator/ValidatableInterfaceElement.swift:141:17: note: candidate has non-matching type '<self r> (rule: R) -> ValidationResult'
    public func validate<r: validationrule>(rule r: R) -> ValidationResult where R.InputType == InputType {
                ^
/Pods/Validator/Validator/Sources/UIKit+Validator/UISlider+Validator.swift:33:1: note: do you want to add protocol stubs?
extension UISlider: ValidatableInterfaceElement {
^
</r:></self>

/Pods/Validator/Validator/Sources/UIKit+Validator/UITextField+Validator.swift:32:1: error: type 'UITextField' does not conform to protocol 'ValidatableInterfaceElement'
extension UITextField: ValidatableInterfaceElement {
^
/Pods/Validator/Validator/Sources/UIKit+Validator/ValidatableInterfaceElement.swift:141:17: note: candidate has non-matching type '<self r> (rule: R) -> ValidationResult'
    public func validate<r: validationrule>(rule r: R) -> ValidationResult where R.InputType == InputType {
                ^
/Pods/Validator/Validator/Sources/UIKit+Validator/UITextField+Validator.swift:32:1: note: do you want to add protocol stubs?
extension UITextField: ValidatableInterfaceElement {
^
</r:></self>

/Pods/Validator/Validator/Sources/UIKit+Validator/UITextView+Validator.swift:11:1: error: type 'UITextView' does not conform to protocol 'ValidatableInterfaceElement'
extension UITextView: ValidatableInterfaceElement {
^
/Pods/Validator/Validator/Sources/UIKit+Validator/ValidatableInterfaceElement.swift:141:17: note: candidate has non-matching type '<self r> (rule: R) -> ValidationResult'
    public func validate<r: validationrule>(rule r: R) -> ValidationResult where R.InputType == InputType {
                ^
/Pods/Validator/Validator/Sources/UIKit+Validator/UITextView+Validator.swift:11:1: note: do you want to add protocol stubs?
extension UITextView: ValidatableInterfaceElement {
^
</r:></self>

Happens on both Swift 3.3 and 4.1. I think this worked on 9b2, but not on 9b3 or 9b4.

该提问来源于开源项目:adamwaite/Validator

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39791653 weixin_39791653 5月前

    It happens on Xcode 9.3 (9E145), Swift 4.1 too.

    点赞 评论 复制链接分享
  • weixin_39721000 weixin_39721000 5月前

    Don't have enough time to explore / follow the full logic of the codebase, but removing the protocol stub and default implementation for:

    public func validate<R: ValidationRule>(rule r: R) -> ValidationResult where R.InputType == InputType

    from ValidatableInterfaceElement.swift

    seems to solve the issue.

    In the App I'm working on, eliminating this method causes no problems - I can still perform validations, as before.

    点赞 评论 复制链接分享
  • weixin_39532699 weixin_39532699 5月前

    Thank you this fix worked for me too!

    I was getting the same error as -is in Xcode 9.3. Xcode 9.2 was working fine.

    点赞 评论 复制链接分享
  • weixin_39822493 weixin_39822493 5月前

    93 is an identical bug with more chatter, so I'll close this in favor of that one.

    点赞 评论 复制链接分享

相关推荐