Skip to content

Negative integer can be decoded as unsigned #859

Description

@StefanFabian

I've made the apparently wrong assumption that node.as<unsigned long long>() would throw a YAML::BadConversion exception if the number is negative.
In reality a value like:

int16s:
  - -15850

will be converted to 18446744073709535766.
In #209, it is argued that bool Nodes should not have an implicit conversion to int (which I support since they are semantically different types), hence, I assume that yaml not throwing in the above case is not intended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions