Can anyone explain the comments in this snippet?
Map<Account, Contact> m = new Map<Account, Contact>();
m.put(new Account(Name='Test'), new Contact(Lastname='Test'));
SObject[] records = new SObject[]{};
for (Account acc : m.keySet()) records.add(acc);
insert records;
System.debug(m); // returns {Account:{Name=Test, Id=0013600001BkcJYABC}=null}
System.debug(m.values()); // returns (Contact:{LastName=Test})
Specifically the map seems to lose its values once its keys are DML'd upon, and yet, the values appear to be there!
I think it is obvious that the map cannot identify its keys once they receive Ids. This looks like a pass-by-reference bug to me.