Skip to content

chore: remove global:: qualifiers from hand-written code - #8387

Merged
Aaronontheweb merged 1 commit into
akkadotnet:devfrom
Aaronontheweb:chore/remove-global-qualifiers
Jul 16, 2026
Merged

Aaronontheweb merged 1 commit into
akkadotnet:devfrom
Aaronontheweb:chore/remove-global-qualifiers

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Member

Motivation

global:: is the right tool in generated code (protobuf .g.cs, source-generator emission), where output must compile inside arbitrary user namespaces that can shadow System/Akka/MessagePack. In hand-written source it's noise — 19 occurrences across 7 files, now replaced with the shortest unambiguous form.

Notable cases

  • ActorCell.FaultHandling.cs / ActorCell.DefaultMessages.cs: introduced using SysDebug = System.Diagnostics.Debug; — inside ActorCell, plain System.Diagnostics.Debug is unwritable (ActorCell.System property shadows the namespace) and unqualified Debug collides with Akka.Event.Debug. The alias is the only clean spelling.
  • Everything else: plain names via new/existing using directives or namespace-qualified forms.

Verification

  • Akka, Akka.Cluster, Akka.Tests, Akka.Remote.Tests all build clean (0 warnings)
  • Directly-affected specs pass: ActorPathSpec (41), AckedDeliverySpec (15), ArteryControlMessageSerializerSpec (32)
  • Zero global:: remains in touched files; generated files untouched

Qualifier/using changes only — no behavior change. (The Serialization.V2 branch got the same treatment separately in #8385.)

global:: belongs in generated code (protobuf .g.cs, source-generator
emission), where output must survive arbitrary user namespaces. In
hand-written source it is noise -- replaced with plain names, usings, or
a SysDebug alias where a genuine collision exists (ActorCell has a System
property and Akka.Event has its own Debug type, so System.Diagnostics.Debug
is unwritable in plain form there).

19 occurrences across 7 files; qualifier changes only, no behavior change.
Affected specs pass: ActorPathSpec 41, AckedDeliverySpec 15,
ArteryControlMessageSerializerSpec 32.
@Aaronontheweb
Aaronontheweb merged commit 03ffbc9 into akkadotnet:dev Jul 16, 2026
11 checks passed
@Aaronontheweb
Aaronontheweb deleted the chore/remove-global-qualifiers branch July 16, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant