Files
swift-mirror/test/Sema/moveonly_objc_enum.swift
Kavon Farvardin 31aa2f77e3 polish noncopyable types diagnostic wordings
- replaces "move-only" terminology with "noncopyable"
- replaces compiler jargon like "guaranteed parameters"
  and "lvalue" with corresponding language-level notions
- simplifies diagnostics about closures.

and probably more.

rdar://109281444
2023-05-24 20:56:36 -07:00

18 lines
500 B
Swift

// RUN: %target-typecheck-verify-swift -enable-experimental-feature MoveOnlyEnumDeinits
// REQUIRES: objc_interop
// Validate that we can't mark an objc enum as move only.
@_moveOnly
@objc enum Foo : Int { // expected-error {{noncopyable enums cannot be marked '@objc'}}
case X, Y, Z
deinit {} // expected-error {{deinitializers cannot be declared on an @objc enum type}}
}
@_moveOnly
@objc enum Foo2 : Int { // expected-error {{noncopyable enums cannot be marked '@objc'}}
case X, Y, Z
}