Could/should type inference of literals be improved?

Yes, I think that should be do-able and would be great to have. We should effectively be able to type-check this as if it had been written as:

func _my_generic_lambda<T : BinaryFloatingPoint>(_ x: T) -> T {
  return x.ft
}

let threeFeet: Float = _my_generic_lambda(3)

@Jens, can you file a JIRA?

3 Likes