flintlang / flint

The Flint Programming Language for Smart Contracts
MIT License
245 stars 18 forks source link

Return in else clauses #454

Closed wmanshu closed 5 years ago

wmanshu commented 5 years ago
  func example(a: Int) -> Bool{
    if a <= b {
      return false
    } else {
    return true
    }
  }

error message: Missing return in function expected to return 'Bool' at the last curly bracket

If it is not a return statement in the clause, program works fine.

mrRachar commented 5 years ago

This issue has been addressed downstream in 77eae93cfb19a79713f926e0ec6aff79c64c0b85, and is thought to work. If you try pulling matteobilardi/flint you can check that it does so properly. If no further issues are found, then this issue will be closed when these changes have been pushed upstream.