mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Specifically: 1. Fix the error message so that when we say you can't have a deinit that a deinit can be on a noncopyable type along side a class or an actor. 2. Even though we already error on @objc enums and say they cannot be noncopyable, we did not emit an error on the deinit saying that @objc enums cannot have a deinit. I put in a nice to have error just to make it even clearer. rdar://105855978 rdar://106566054
11 lines
374 B
Plaintext
11 lines
374 B
Plaintext
// RUN: %target-typecheck-verify-swift
|
|
|
|
typealias Int = ()
|
|
|
|
deinit // expected-error {{deinitializers may only be declared within a class, actor, or noncopyable type}}
|
|
|
|
subscript (x : Int, y : Int) -> Int { get }// expected-error{{'subscript' functions may only be declared within a type}}
|
|
|
|
init(i:Int) // expected-error {{initializers may only be declared within a type}}
|
|
|