It looks like a bug, where the init(rawValue:) initializer isn't being created (or isn't available) if you have defined any other initializers. Presumably it still works in playgrounds because the line-by-line compilation creates a state where the enum exists and your custom initializers don't yet.Unlike the other automatic initializers for other types, the documentation doesn't say that it isn't created if you define other initializers. (The documentation explicitly states that default initializers for structs and classes, and member-wise initializers for structs, aren't created if you define your own initializers.)I would recommend filing a bug with Apple, so that either it gets fixed or the documentation gets updated to reflect its behavior (if it's intentional so that all automatically generated initializers have similar behavior).