You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this recently. I'd have expected this to work fine:
importValidateexposing (ifBlank, ifInvalidEmail, ifNotInt)
modelValidator =Validate.all
[Validate.firstError
[ ifBlank .email "Please enter an email address.", ifInvalidEmail .email "This is not a valid email address."], ifNotInt .age "Age must be a whole number."]validate modelValidator { email ="", age ="5"}--> [ "Please enter an email address." ]validate modelValidator { email ="foo@bar", age ="5"}--> [ "This is not a valid email address." ]validate modelValidator { email ="[email protected]", age ="5"}--> []
However, this doesn't compile (says modelValidator is undefined) unless I add this annotation:
modelValidator:ValidatorString { email : String, age : String }
It's
The text was updated successfully, but these errors were encountered:
I ran into this recently. I'd have expected this to work fine:
However, this doesn't compile (says
modelValidator
is undefined) unless I add this annotation:It's
The text was updated successfully, but these errors were encountered: