Enum case value cannot use expression macro? Only real literal allow?

// this works!
let x = #radians(45 - 45 + 18)

enum Foo: Double {
  case north = #radians(45 - 45 + 18)   // Raw value for enum case must be a literal
}

Wouldn't it be easier for you to use a struct instead?

struct Direction: RawRepresentable {
    var rawValue: Double
    init(rawValue: Double) {
        self.rawValue = rawValue
    }
    static let north = Direction(rawValue: 90*0)
    static let east = Direction(rawValue: 90*1)
    static let south = Direction(rawValue: 90*2)
    static let west = Direction(rawValue: 90*3)
}

What are the benefits of enums that are important for you here? Exhaustiveness of switch statement? CaseIterable? (you could still do the latter with a struct).

Could it be that the macro does not return a FloatLiteralExprSyntax, but some other ExprSyntax?

The compiler doesn’t allow anything except a literal. Anything else is not allowed and is a compile error. So the macro is never called.

All right. One workaround might be to use a macro that outputs entire enum cases instead.