-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
Self in classFeature → types: The 'Self' type in classesFeature → types: The 'Self' type in classesactorFeature → concurrency: `actor` declarationsFeature → concurrency: `actor` declarationsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresdeclarationsFeature: declarationsFeature: declarationsswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected errorBug: Unexpected errorBug: Unexpected error
Description
Description
using the Self
shorthand with an isolated
parameter results in error: 'isolated' parameter has non-actor type 'Self'
.
Reproduction
actor A
{
init() {}
}
extension A
{
nonisolated
func f() async
{
- await { (self:isolated A) in } (self)
+ await { (self:isolated Self) in } (self)
}
}
Expected behavior
as actors do not allow inheritance, Self
should be equivalent to spelling out the full type name
Environment
$ swiftc --version
Swift version 5.9.2 (swift-5.9.2-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional information
forum thread: https://forums.swift.org/t/isolated-parameter-has-non-actor-type-self/69440/2
Metadata
Metadata
Assignees
Labels
Self in classFeature → types: The 'Self' type in classesFeature → types: The 'Self' type in classesactorFeature → concurrency: `actor` declarationsFeature → concurrency: `actor` declarationsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresdeclarationsFeature: declarationsFeature: declarationsswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistypesFeature: typesFeature: typesunexpected errorBug: Unexpected errorBug: Unexpected error