question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use covariant returns for `Owner` property in accessible objects

See original GitHub issue

Since 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:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
NikitaSemenovAkveloncommented, Nov 9, 2022

Created an Issue about this bug https://github.com/dotnet/runtime/issues/78090

0reactions
NikitaSemenovAkveloncommented, Nov 17, 2022

Looks like the exception won’t be fixed (https://github.com/dotnet/runtime/issues/78090#issuecomment-1309457613). Thereby we can’t resolve this issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found