Use covariant returns for `Owner` property in accessible objects
See original GitHub issueSince C# 9 we can use covariant returns, though we never got around enhancing the code. Updating the code will allow us to remove the duplicate fields and use Owner
property throughout.
_Originally posted by @RussKie in https://github.com/dotnet/winforms/pull/7954#discussion_r998992435_
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Covariant return types - C# 9.0 draft feature specifications
This feature specification describes covariant return types, ... The overriding property's type must be at least as accessible as the ...
Read more >C# Covariant Returns for Auto-Implemented Properties
In C# 9 properties are only able to have co-variant returns when they are readonly, so unfortunately, no set; is possible.
Read more >C# Futures: Covariant Return Types - InfoQ
A frequent API design problem is the inability to use a more specific return type when overriding a method. Proposal 49, which is...
Read more >How to use target typing and covariant returns in C# 9
Use covariant return types in C# 9 Covariant return types is a feature that enables you to override a method of a base...
Read more >Marshal.GetIUnknownForObject throws a ...
Using a class with a covariant property as the o parameter of Marshal.GetIUnknownForObject causes a TypeLoadException .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Created an Issue about this bug https://github.com/dotnet/runtime/issues/78090
Looks like the exception won’t be fixed (https://github.com/dotnet/runtime/issues/78090#issuecomment-1309457613). Thereby we can’t resolve this issue.