Values descriptions format inconsistency

I'm getting this disparity when printing values:

enum E { case foo }
let value = E.foo
let a = "\(value)"    // "foo"
let b = "\([value])"  // "[AppName.E.foo]"

Shouldn't it be consistent:

  • either "AppName.E.foo" in the first place to match the second
  • or "[foo]" in the second place to match the first?
1 Like

Arrays always print their elements with String(reflecting:), mainly so that an array of strings has its elements clearly delimited.