-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Labels
actorFeature → concurrency: `actor` declarationsFeature → concurrency: `actor` declarationsactor isolationFeature → concurrency: Actor isolationFeature → concurrency: Actor isolationbugA 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 featuresdefault argumentsFeature: default arguments for value parametersFeature: default arguments for value parameterstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected error
Description
| Previous ID | SR-15916 |
| Radar | None |
| Original Reporter | @groue |
| Type | Bug |
Environment
Xcode 13.3 beta 3 (13E5104i)
Additional Detail from JIRA
| Votes | 2 |
| Component/s | Compiler |
| Labels | Bug |
| Assignee | None |
| Priority | Medium |
md5: 618b69843e92ff0edf9587c87894767b
Issue Description:
Hello,
The following snippet does not compile:
@MainActor class Foo { }
// error: call to main actor-isolated initializer 'init()' in a synchronous nonisolated context
// @MainActor func f(foo: Foo = Foo()) { }
// ^
// note: calls to initializer 'init()' from outside of its actor context are implicitly asynchronous
// @MainActor class Foo {
// ^
@MainActor func f(foo: Foo = Foo()) { }It should compile, since everything in the declaration of the f function is MainActor-isolated.
iainsmith, danthorpe, kirsteins, KoCMoHaBTa, tavares1 and 5 more
Metadata
Metadata
Assignees
Labels
actorFeature → concurrency: `actor` declarationsFeature → concurrency: `actor` declarationsactor isolationFeature → concurrency: Actor isolationFeature → concurrency: Actor isolationbugA 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 featuresdefault argumentsFeature: default arguments for value parametersFeature: default arguments for value parameterstype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysisunexpected errorBug: Unexpected errorBug: Unexpected error