Skip to content

The Norway problem #66

@vpanteleev-sym

Description

@vpanteleev-sym

D program:

import std.stdio;
import configy.read;

void main()
{
    struct C { string[] countries; }
    auto c = parseConfigFileSimple!C("test.yaml");
    writeln(c.get());
}

YAML:

countries:
  - UK
  - NO
  - US

Expected output:

C(["UK", "NO", "US"])

Actual output:

C(["UK", "false", "US"])

Because we know we're deserialising into a string, we should capture the original token and then parse that as needed depending on the desired type, instead of eagerly converting to bool and then stringifying it.

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