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
contract Reputation {
...
var ratings: [Address : [Feedback]] = [:]
}
struct Feedback {
var isPositive: Bool
var reviewer: Address
var optionalMessage: String
}
public func getNumberOfPositiveReviews(recipient: Address) -> Int
{
let feedback: [Feedback] = ratings[recipient]
var count: Int = 0
for var f: Feedback in feedback {
if f.isPositive {
count += 1
}
}
return count
}
error (--skip-verifier case):
Arrays and dictionaries cannot be defined as local variables yet
at let feedback: [Feedback] = ratings[recipient]
file: reputation.flint
The text was updated successfully, but these errors were encountered:
struct S {
var x: Int
var y: Int
init(x: Int, y: Int) {
self.x = x
self.y = y
}
}
contract A {
var arr2: [Address: [S]] = [:]
}
A :: caller <- (any) {
public init() {}
func getarr2()
pre (dictContains(arr2, caller) == true)
{
var ss: [S] = arr2[caller]
}
}
error (
--skip-verifier
case):at
let feedback: [Feedback] = ratings[recipient]
file: reputation.flint
The text was updated successfully, but these errors were encountered: