I have something similar to following:
for(CustomMetadataType__mdt config : CustomMetadataType__mdt.getAll().values()){
//we usually use this to access the field values
System.debug(config.Field_Name__c);
//but this seems to work as well!
System.debug(config.get('Field_Name__c'));
}
Is this a known thing and how come? get() is used both with map (with key) and list (with index). Interested to know about this behavior. Thanks!