Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Allow reabstraction of default interface methods#23313

Merged
MichalStrehovsky merged 8 commits intodotnet:masterfrom
MichalStrehovsky:reabstraction
Apr 8, 2019
Merged

Allow reabstraction of default interface methods#23313
MichalStrehovsky merged 8 commits intodotnet:masterfrom
MichalStrehovsky:reabstraction

Conversation

@MichalStrehovsky
Copy link
Copy Markdown
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 * The PR is not ready for merge yet (see discussion for detailed reasons) label Mar 18, 2019
@jkotas
Copy link
Copy Markdown
Member

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 * The PR is not ready for merge yet (see discussion for detailed reasons) label Apr 3, 2019
@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked CoreFX Tests

1 similar comment
@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked CoreFX Tests

@MichalStrehovsky MichalStrehovsky merged commit 24c92a5 into dotnet:master Apr 8, 2019
@MichalStrehovsky MichalStrehovsky deleted the reabstraction branch April 8, 2019 11:14
picenka21 pushed a commit to picenka21/runtime that referenced this pull request 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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants