mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SE-0306] Disable actor inheritance.
Actor inheritance was removed in the second revision of SE-0306. Remove the ability to inherit actors. Note that this doesn't fully eliminate all vestigates of inheritance from actors. There are simplifications that need to be performed still, e.g., there's no need to distinguish designated/convenience/required initializers. That will follow.
This commit is contained in:
@@ -4,16 +4,17 @@
|
||||
|
||||
actor MyActor { }
|
||||
|
||||
class MyActorSubclass1: MyActor { }
|
||||
class MyActorSubclass1: MyActor { } // expected-error{{actor types do not support inheritance}}
|
||||
// expected-error@-1{{non-final class 'MyActorSubclass1' cannot conform to `Sendable`; use `UnsafeSendable`}}
|
||||
|
||||
actor MyActorSubclass2: MyActor { }
|
||||
actor MyActorSubclass2: MyActor { } // expected-error{{actor types do not support inheritance}}
|
||||
|
||||
// expected-warning@+1{{'actor class' has been renamed to 'actor'}}{{7-13=}}
|
||||
actor class MyActorClass { }
|
||||
|
||||
class NonActor { }
|
||||
|
||||
actor NonActorSubclass : NonActor { } // expected-error{{actor cannot inherit from non-actor class 'NonActor'}}
|
||||
actor NonActorSubclass : NonActor { } // expected-error{{actor types do not support inheritance}}
|
||||
|
||||
// expected-warning@+1{{'actor class' has been renamed to 'actor'}}{{14-20=}}
|
||||
public actor class BobHope {}
|
||||
|
||||
Reference in New Issue
Block a user