paiden / Nett

.Net library for TOML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coma: AutoConversion of TomlTable to Dictioary<...,...>not working

paiden opened this issue · comments

While Nett handles cases like these without problems:

public class Root
{
    public string X { get; set; }

    public Dictionary<string, bool> Items { get; set; } = new Dictionary<string, bool>();
}

const string tml = @"
X = 'test'
[Items]
one = true
two = false
three = true";

var x = Toml.ReadString<Root>(tml); //X.items has 3 items

Coma is not able to do so. Coma returns an empty dictionary for this scenario because it cannot convert the TomlTable to the Dictionary<string, bool>.

This is because for Coma different conversion rules are applied because of other type information is available at different points in time...