Skip to content

Error: Arrays and dictionaries cannot be defined as local variables yet #466

@wmanshu

Description

@wmanshu
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions