TipKit Rule won't compile

    static let hoverEvent: Event = Event(id: "hoverEvent")
    /// Parameters-Rules
    @Parameter
    static var isHovering: Bool = false
    static var tipCountKey = "UserTipCount"

    var title: Text
    var message: Text?
    var image: Image?
    var tipShownLimit: Int
    @ObservedObject var buttonState: ButtonState
    
    var rules: [Rule] {
        #Rule(Self.hoverEvent) {
            $0.donations.count < tipShownLimit
        }
    }
}

error: Event Rules require a count comparison. If I replace tipShownLimit like this: var rules: [Rule] { #Rule(Self.hoverEvent) { $0.donations.count < 3 } }

it compiles fine. the error is: Event Rules require a count comparison.

Missed the first line of code:

    static let hoverEvent: Event = Event(id: "hoverEvent")
    /// Parameters-Rules
    @Parameter
    static var isHovering: Bool = false
    static var tipCountKey = "UserTipCount"

    var title: Text
    var message: Text?
    var image: Image?
    var tipShownLimit: Int
    @ObservedObject var buttonState: ButtonState

    var rules: [Rule] {
        [
        #Rule(Self.$isHovering) {
            $0 == true
        },
        #Rule(Self.hoverEvent) {
                $0.donations.count < 10
            }
        ]
    }
}

first line of code:

struct UserTip: Tip {

I expanded the macro, and wrote the value myself. It seems this fixed the issue.

                PredicateExpressions.build_Equal(
                    lhs: PredicateExpressions.build_KeyPath(
                        root: PredicateExpressions.build_KeyPath(
                            root: PredicateExpressions.build_Arg($0),
                            keyPath: \.donations
                        ),
                        keyPath: \.count
                    ),
                    rhs: PredicateExpressions.build_Arg(tipShownLimit)
                )
            }
TipKit Rule won't compile
 
 
Q