I'm getting this error in my project: Recursive enum 'Optional<Wrapped>' is not marked 'indirect'
But the project contains only one enum, and it isn't recursive. This is all there is to it:
enum SymbolType { case ATM, UOP, BOP, LP, RP, NaS }The debugger provides no line number for the error. Can anyone advise me about how to track this down? It seemed to come out of nowhere.
dkj
The issue you have here is that
Formula is a recursive struct (via the
subformulas property), which Swift doesn’t allow. The error message is completely bogus, but if you comment out enough code you’ll eventually get the right error.
/Users/quinn/Desktop/xxy/xxy/Formula.swift:11:8: error: recursive value type 'Formula' is not allowed
struct Formula {It’s clear that Swift’s diagnostics have failed you completely here; please file a bug about that, then post your bug number, just for the record.
As to what you should do, you have the usual options when dealing with recursive data structures:
use a reference type
use an indirect enum
If someone can tell me what's causing this error, I'll name my first-born child after them.
Nah, there’s already too many Quinns in this world (-:
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"