Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type conversion in the default pair deconstructor implementation #618

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Nov 10, 2021

The code using the TypeConverter was written backwards (using ConvertTo instead of ConvertFrom) and would thus throw an exception. For example, when converting an enum:

System.NotSupportedException: 'EnumConverter' is unable to convert 'System.String' to 'System.DayOfWeek'.

A test covering conversion of enums was added: Should_Map_Pairs_With_Enum_Value_To_Pair_Deconstructable_Collection_Using_Default_Deconstructor

The code using the TypeConverter was written backwards (using `ConvertTo` instead of `ConvertFrom` and would thus throw an exception. For example, when converting an enum:
> System.NotSupportedException: 'EnumConverter' is unable to convert 'System.String' to 'System.DayOfWeek'.

A test covering conversion of enums was added: `Should_Map_Pairs_With_Enum_Value_To_Pair_Deconstructable_Collection_Using_Default_Deconstructor`
Copy link
Contributor

@nils-a nils-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nils-a nils-a merged commit 8fed3bc into spectreconsole:main Nov 22, 2021
@nils-a
Copy link
Contributor

nils-a commented Nov 22, 2021

@0xced your changes have been merged, thanks for your contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conversion in the default pair deconstructor is wrong
2 participants