Skip to content

Remove implicit conversion from string to Config #7822

@AlwaysBlind

Description

@AlwaysBlind

Is your feature request related to a problem? Please describe.

The implicit conversion from string to Akka.Configuration.Config hides important intent and makes code less explicit. This can introduce subtle bugs where a plain string is unintentionally treated as a configuration object. It reduces readability and makes debugging harder, since the conversion is not obvious to readers or tools.

Describe the solution you'd like

Remove the implicit operator Config(string str) from the API. Users should explicitly call ConfigurationFactory.ParseString(str) when they want to create a Config instance. This makes intent clear and avoids unintentional type conversions.

Describe alternatives you've considered

  1. Keeping the implicit operator but marking it [Obsolete] with a compiler warning, guiding developers to use ConfigurationFactory.ParseString explicitly.

  2. Changing the operator to explicit instead of implicit, requiring an explicit cast in code but keeping backward compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions