new
Macros
Compile-time code generation with full type information. This is the mechanism behind @Observable and much of SwiftData, so understanding what a macro expands to is now part of reading ordinary framework code.
Affects
Macros arrive as a first-class language feature, and the ownership model gains noncopyable types.
Compile-time code generation with full type information. This is the mechanism behind @Observable and much of SwiftData, so understanding what a macro expands to is now part of reading ordinary framework code.
Affects
A type can declare that it must not be copied, giving the compiler enough information to enforce unique ownership of a resource. Relevant when a value represents something that genuinely cannot be duplicated, such as a file handle or a lock.
Affects
Both can now produce a value directly, which removes a great deal of var x: T followed by assignment in every branch.
Affects