weixin_39669769
weixin_39669769
2020-12-06 19:02

Missing return in a function expected to return 'Bool'

Upgraded to Swift 5 and build fails on ValidationResult.swift - isValid does not return a Bool


public enum ValidationResult {

    case valid

    case invalid([ValidationError])

    public var isValid: Bool {

        self == .valid
    }
}

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

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

4条回答

  • weixin_39638929 weixin_39638929 5月前

    Do you have plans to make a new release that will include this fix soon? Latest version still has this problem

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

    Done 3.2.1

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

    Thanks! I just noticed that part of the same commit that introduced this bug, merge methods on ValidationResult were removed. Was this intentional? if so, what is the right way of merging multiple results now?

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

    Thanks! I just noticed that part of the same commit that introduced this bug, merge methods on ValidationResult were removed. Was this intentional? if so, what is the right way of merging multiple results now?

    Is this question solved?

    点赞 评论 复制链接分享

相关推荐