Skip to content
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

Allow reabstraction of default interface methods #23313

Merged
merged 8 commits into from Apr 8, 2019

Conversation

MichalStrehovsky
Copy link
Member

@MichalStrehovsky MichalStrehovsky commented Mar 18, 2019

Allow the runtime to load types with incomplete interface implementations. With this change, we allow (in pseudo-C#):

interface IFoo { void Frob() { } } 
interface IBar : IFoo { abstract void IFoo.Frob() }
class Fooer : IBar { }

Calling IFoo.Frob on an instance of Fooer will result in new exception being thrown because the default implementation of IFoo.Frob was re-abstracted by IBar.

@MichalStrehovsky MichalStrehovsky added the * NO MERGE * label Mar 18, 2019
@jkotas
Copy link
Member

@jkotas jkotas commented Mar 18, 2019

Get a new exception type approved in CoreFX

We may consider throwing EntryPointNotFoundException. The type system throws this exception today for similar situations, e.g. https://github.com/dotnet/coreclr/blob/master/src/vm/virtualcallstub.cpp#L2362

@MichalStrehovsky MichalStrehovsky removed the * NO MERGE * label Apr 3, 2019
@MichalStrehovsky
Copy link
Member Author

@MichalStrehovsky MichalStrehovsky commented Apr 5, 2019

@dotnet-bot test Ubuntu x64 Checked CoreFX Tests

1 similar comment
@MichalStrehovsky
Copy link
Member Author

@MichalStrehovsky MichalStrehovsky commented Apr 8, 2019

@dotnet-bot test Ubuntu x64 Checked CoreFX Tests

@MichalStrehovsky MichalStrehovsky merged commit 24c92a5 into dotnet:master Apr 8, 2019
41 checks passed
@MichalStrehovsky MichalStrehovsky deleted the reabstraction branch Apr 8, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this issue Feb 18, 2022
Allow the runtime to load types with incomplete interface implementations. With this change, we allow (in pseudo-C#):

```csharp
interface IFoo { void Frob() { } } 
interface IBar : IFoo { abstract void IFoo.Frob() }
class Fooer : IBar { }
```

Calling IFoo.Frob on an instance of `Fooer` will result in new exception being thrown because the default implementation of `IFoo.Frob` was re-abstracted by `IBar`.

Commit migrated from dotnet/coreclr@24c92a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants