Since SwiftFormat version 0.46.0, type definitions have been removed from ternary operator code with the following, causing a compile error.
* output
```output.swift
let foo = Bar.hoge() ? .bar1 : .bar2
The reason seems to be that the following commits don't take into ternary operators.
I tried to look for a good fix, but I couldn't think of one right away, so I'll make an Issue.
https://github.com/nicklockwood/SwiftFormat/commit/fa60eaf12aeb4981046bf48adbc03eb31271820f
@zizi4n5 thanks for reporting, this is definitely a bug. Possible workarounds are:
1) Change the code to:
let foo = Bar.hoge() ? Bar.bar1 : .bar2
2) Add the following comment above that line:
// swiftformat:disable:next redundantType
3) Add the following to your swiftformat config
--disable redundantType
@nicklockwood
Thanks for your comment.
I got around it the second way.
Add the following comment above that line:
// swiftformat:disable:next redundantType
@zizi4n5 fixed in 0.46.3
Most helpful comment
@zizi4n5 thanks for reporting, this is definitely a bug. Possible workarounds are:
1) Change the code to:
2) Add the following comment above that line:
3) Add the following to your swiftformat config