SE-0255: Implicit Returns from Single-Expression Functions

I think this would fit perfectly with the language and would save me from frequently writing functions and computed properties without the return, expecting exactly this to work already. This makes things both more concise but also more consistent in my mind.

Much more speculatively (and therefore not a major consideration), this proposal might also open a door for solving some other small-but-frequently-discussed annoyances in the language. e.g. there have been recent discussions in the pitch thread for if-else expressions (where if-else statements are expressions if all the clauses are single expressions) about extending that idea to switch statements as well, and implicit returns for single-expression functions would give you a nice way to write functions on enums where the body is just a switch statement. Roughly:

enum GameResult {
  case loss, draw, win
  
  func points() -> Int {
    switch self {
      case .loss: -1
      case .draw:  0
      case .win:   1
    }
  }
}

As I said in the pitch thread, I'm really not a fan of the idea of adding a whole new syntax with no clear benefit (it doesn't seem to eliminate any ambiguity for me). If a concise syntax is desirable, then I think this should be:

func sum() -> Element { reduce(0, +) }

which achieves the goal of allowing “one liners”, so I'm not sure what failure you are talking about.