-
-
Notifications
You must be signed in to change notification settings - Fork 206
fix: don't emit unnecessary null-handling if source and target are nullable #2100
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,13 @@ TestSourceBuilderOptions.Default with | |
|
|
||
| [Fact] | ||
| public void NonNullableToNullableValueType() | ||
| { | ||
| var source = TestSourceBuilder.Mapping("int[]?", "int[]?"); | ||
| TestHelper.GenerateMapper(source).Should().HaveSingleMethodBody("return source;"); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void NonNullableToNullableValueType2() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test method name 'NonNullableToNullableValueType2' is unclear due to the '2' suffix. Consider a more descriptive name that explains what distinguishes this test from similar tests, such as 'NonNullableToNullableValueTypeCast' or 'NonNullableDateTimeToNullableDateTime'. |
||
| { | ||
| var source = TestSourceBuilder.Mapping("DateTime", "DateTime?"); | ||
| TestHelper.GenerateMapper(source).Should().HaveSingleMethodBody("return (global::System.DateTime?)source;"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.