-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Nullability issue with DisposeWith at Bind, OneWayBind #2486
Comments
Possible duplicate issue with #2467 |
I think the problem here is the fact that Bind returns a disposable value when it probably shouldn't. |
With recent update, bind returns nullable disposable. And the null value itself does not need to dispose, of course. Hmmm, I'm confused with the nullable parameter ViewModel in bind method now. |
The view model isn't the issue. I will work on a fix tomorrow. |
This is not a duplicate of #2467.
This is because the ViewModel is being passed in not because it's actually being used within the function. Rather, it's there to provide typing information on what would otherwise be a massive generic you would need to write out. By passing it in, the typing can be inferred, and so you don't have to write it. And since it's not actually being used, it's made nullable so that it lines up with ReactiveControl's member, which is also nullable. |
Hold off on any PRs for the moment just doing some stuff at the moment related. |
Fixed in ac9e712 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
The compiler warns about "[CS8631] Nullability of type argument doesn't match constraint type." when building application with c# 8.0 Nullable reference types enabled in .netcore3.1
Steps To Reproduce
Code behind xaml:
When build the application, the complier warns about [CS8631]
Expected behavior
Should be without any warning.
It seems that
System.Reactive.Disposables.DisposeWith
does not except a Nullable value as parameter(which writes as IDisposable Extensions in class DisposableMixins)I've write a new DisposeWith which accepts nullable value
But it conflicts with original DisposeWith Extension because they share same method signature.
Hence renaming to DisposeWithNullable or some other might be a workaround, tills lots of code should be modified to fix this wanring.
So what's the proper way to resolve this Nullability issue?
Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: