Replies: 22 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Agree with @HaloFour. Since practically speaking C# 8.0 is largely only for .NET Core (a much smaller and newer subset of all .NET code), I think the bar for breaking changes should be a little lower. Having pattern based Dispose everywhere doesn't seem like that dangerous a change or a very difficult one to resolve if it does break someone somewhere. |
Beta Was this translation helpful? Give feedback.
-
uhhh, what? The only feature that is locked to Core at the moment, AFAIK, is DIM. |
Beta Was this translation helpful? Give feedback.
-
none of which applies to using declarations. is that acceptable to do this only for using decls? |
Beta Was this translation helpful? Give feedback.
-
On nullable analysis: The analysis part, on the other hand, will never be perfect, and it will be a moving target over the long run. So many of the advanced scenarios may be better left to analyzers. That's also a good space for 3rd party analyzers to explore. |
Beta Was this translation helpful? Give feedback.
-
Default interfaces, asynchronous streams, and ranges all require .NET Core as far as I'm aware, because Microsoft has stated they are not making further changes to the .NET Framework. |
Beta Was this translation helpful? Give feedback.
-
Asynchronous streams and ranges will work on any platform as long as suitable types with suitable names are available. They don't have to be defined in the framework. |
Beta Was this translation helpful? Give feedback.
-
@gafter Are there plans to release packages for those types that are usable in .NET Framework? My understanding was that that wasn't happening. |
Beta Was this translation helpful? Give feedback.
-
@MgSam I don't know. I would be shocked if someone doesn't make such packages available. |
Beta Was this translation helpful? Give feedback.
-
Not only is this disappointing, it is inconsistent with
|
Beta Was this translation helpful? Give feedback.
-
Yes, and we would make them consistent if we could do so without breaking compatibility. Since this is crucial for struct types (which cannot implement interfaces), and unnecessary for other types (which can), it seems like the sweet spot. |
Beta Was this translation helpful? Give feedback.
-
Has evidence of the compatibility break been seen in the field?
It's still necessary if you want to make a non-ref type disposable which you don't own. |
Beta Was this translation helpful? Give feedback.
-
Yes, there have been many times that we've changed a language feature due to customer-reported breaks. Or are you asking if we've released this feature with an intentional compatibility break? No. |
Beta Was this translation helpful? Give feedback.
-
Has evidence of this compatibility break been seen (customer has explicit IDisposable.Dispose and also an instance or extension Dispose method which is materially different)? Or is the decision (to remove the ability to make third-party types disposable with extension methods) just out of anticipation of the possibility of a break? |
Beta Was this translation helpful? Give feedback.
-
Would an acceptable compromise be to not support pattern-based dispose specifically with enumerators in |
Beta Was this translation helpful? Give feedback.
-
I typed that comment up in a restaurant last night so in case I was a little too terse to clearly convey my suggestion I'll expound on it a little: I'm thinking that in order to keep the rules simple and to avoid any breaking changes that pattern-based disposal only applies when using the When using I don't think that this is very different from the situation with "awaiters" today. They are 90% pattern-based, but are required to implement * This is a breaking change but I assume that supporting disposal of a |
Beta Was this translation helpful? Give feedback.
-
No, we didn't seek to analyze all customer code to find out if there would be a break. We didn't see that part of the feature as important enough for that level of effort. Moreover, the break would arise from extension |
Beta Was this translation helpful? Give feedback.
-
Isn't the IDisposable interface going to be preferred over resolving extension and instance methods? The behavior would then not be able to change unless (besides adding an extension method) the type stopped implementing IDisposable. And if this is a concern, why is it being enabled for |
Beta Was this translation helpful? Give feedback.
-
"Hopefully the community does it because we're not going to" is equivalent to "not officially supported". Which means that for many customers it just will not be an option. And even if/when someone does make such packages, it would still mean that you won't be able to use these features in a .NET Standard library targeting both Framework and Core since they'll be .NET Standard 3.0 only, and Framework will never implement .NET Standard 3.0. I know it's not your team that is responsible for the BCL, but the reality is the decision to drop official Framework support means using C# 8.0 on Framework is going to be difficult, confusing and, in my opinion, avoided. So maybe since this release is already a breaking change for many C# customers, the bar should be lower about what constitutes a breaking language change. |
Beta Was this translation helpful? Give feedback.
-
I'd hope that MS would add their own "official" NuGet package for when targeting Framework, like they did for ValueTuple. Otherwise I agree, we don't need a bunch of competing implementations of the same type creating collision and confusion, either for Framework or for .NET Core pre-3.0. |
Beta Was this translation helpful? Give feedback.
-
You lost me here. If all you need are the basic types like |
Beta Was this translation helpful? Give feedback.
-
Dynamically, yes. We test using an |
Beta Was this translation helpful? Give feedback.
-
Dec 5
Dec 12
Jan 7
Nullable:
Beta Was this translation helpful? Give feedback.
All reactions