Skip to content

feature: Add C# 8 Nullability #2428

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

Merged
merged 44 commits into from
Jul 28, 2020
Merged

feature: Add C# 8 Nullability #2428

merged 44 commits into from
Jul 28, 2020

Conversation

RLittlesII
Copy link
Member

What kind of change does this PR introduce?

Adds C# Nullability Support

What is the current behavior?

Not nullability support

What is the new behavior?

All the nulls!

What might this PR break?

A lot? Technically nothing that isn't already potentially broken.

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

@RLittlesII RLittlesII requested review from a team June 3, 2020 20:03
@@ -83,14 +85,14 @@ public IScheduler Scheduler
/// Gets or sets a command which will navigate back to the previous element in the stack.
/// </summary>
[IgnoreDataMember]
public ReactiveCommand<Unit, Unit> NavigateBack { get; protected set; }
public ReactiveCommand<Unit, Unit>? NavigateBack { get; protected set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think these ones should ever be null. It's due to the SetupRx() method being called in the constructor. Let's just make sure they are constructed.

private static IScheduler _unitTestMainThreadScheduler;
private static IScheduler _mainThreadScheduler;
private static IObserver<Exception> _defaultExceptionHandler;
private static IScheduler? _unitTestMainThreadScheduler;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we want these to be nullable. Again probably should be set from the static constructor some how.

@glennawatson glennawatson changed the base branch from master to main June 8, 2020 05:02
@codecov
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #2428 into main will decrease coverage by 0.94%.
The diff coverage is 33.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2428      +/-   ##
==========================================
- Coverage   52.67%   51.73%   -0.95%     
==========================================
  Files         114      114              
  Lines        4459     4525      +66     
  Branches      688      793     +105     
==========================================
- Hits         2349     2341       -8     
- Misses       1926     1959      +33     
- Partials      184      225      +41     
Impacted Files Coverage Δ
.../ReactiveUI.Blend/FollowObservableStateBehavior.cs 0.00% <ø> (ø)
...activeUI.Blend/Platforms/net4/ObservableTrigger.cs 0.00% <ø> (ø)
...ReactiveUI.Fody.Analyzer/ReactiveObjectAnalyzer.cs 0.00% <0.00%> (ø)
...eUI.Fody.Helpers/ObservableAsPropertyExtensions.cs 44.44% <ø> (ø)
...tiveUI.Fody.Helpers/ReactiveDependencyAttribute.cs 0.00% <0.00%> (ø)
src/ReactiveUI.Fody/CecilExtensions.cs 0.00% <0.00%> (ø)
src/ReactiveUI.Fody/ModuleWeaver.cs 0.00% <0.00%> (ø)
src/ReactiveUI.Fody/ObservableAsPropertyWeaver.cs 0.00% <0.00%> (ø)
...eactiveUI.Fody/ReactiveDependencyPropertyWeaver.cs 0.00% <0.00%> (ø)
src/ReactiveUI.Fody/ReactiveUIPropertyWeaver.cs 0.00% <0.00%> (ø)
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ad1155...55f658c. Read the comment docs.

@@ -13,6 +13,7 @@
using System.Runtime.Serialization;
using DynamicData;
using DynamicData.Binding;
#pragma warning disable 8618
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove SetupRX() and put it in the constructor, suspect that will make your nullables work without the need for this pragma.

@RLittlesII RLittlesII requested a review from a team July 28, 2020 07:54
@glennawatson glennawatson changed the title housekeeping: Updated C# 8 Nullability feature: Updated C# 8 Nullability Jul 28, 2020
@glennawatson glennawatson changed the title feature: Updated C# 8 Nullability feature: Add C# 8 Nullability Jul 28, 2020
@glennawatson glennawatson merged commit 5e9219f into main Jul 28, 2020
@glennawatson glennawatson deleted the feature/nullable branch July 28, 2020 09:56
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants