Skip to content

calling new Config( Config a, Config b ) mutates Config a #3885

@boekabart

Description

@boekabart

On Akka.Net 1.3.14:

When using the Config constructor with 2 Config parameters, it not only returns a new Config instance, but it also mutates the first passed Config instance.

Repro (Linqpad):

var c1 = ConfigurationFactory.ParseString("akka.some-key = value");
var c2 = ConfigurationFactory.ParseString("akka.other-key = 42");

c1.ToString().Dump("c1");
c2.ToString().Dump("c2");

var c3 = new Config(c1, c2).ToString(true);
c3.Dump("c3 = new Config(c1,c2).ToString(true)");
c1.ToString().Dump("c1");
c2.ToString().Dump("c2");

Result:
c1

  akka : {
    some-key : value
  }

c2

  akka : {
    other-key : 42
  }

c3 = new Config(c1,c2).ToString(true)

  akka : {
    some-key : value
    other-key : 42
  }

c1

  akka : {
    some-key : value
    other-key : 42
  }

c2

  akka : {
    other-key : 42
  }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions