Skip to content

Missing note for duplicate global actor annotations #82702

Open
@rauhul

Description

@rauhul

Description

There should be a note indicating where the other annotations are in source.

Reproduction

@MainActor // func uhoh-commented-out() {
//   print("oops")
// }
@MainActor func myFunction() {}
➜  Desktop (main 6/9/25) swiftc -c test.swift
test.swift:4:17: error: declaration can not have multiple global actor attributes ('MainActor' and 'MainActor')
2 | //   print("oops")
3 | // }
4 | @MainActor func myFunction() {}
  |                 `- error: declaration can not have multiple global actor attributes ('MainActor' and 'MainActor')
5 |
6 |

Expected behavior

a note referring to source location 1:1.

Environment

$ swiftc --version
Apple Swift version 6.2-dev (LLVM 3c4a54b02dd62b7, Swift a40a7be6945a895)
Target: arm64-apple-macosx16.0
Build config: +assertions

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellabugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresgood first issueGood for newcomerstriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions