forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check the correct interface list in IsInterfaceImplementationMarkedRe…
…cursively (dotnet/linker#1429) `IsInterfaceImplementationMarkedRecursively` was incorrectly rewritten from a global prepass to a local interface walk in dotnet/linker#1186. The new code was looking at the wrong interface list (looking at `IBar`'s interface list instead of `Bar`). We need to keep looking at the same interface list that we started with. Fixes dotnet/linker#1421. Commit migrated from dotnet/linker@fc5e4aa
- Loading branch information
1 parent
3b7cd2c
commit 3271c4c
Showing
2 changed files
with
73 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...s.Cases/Inheritance.Interfaces/OnReferenceType/InterfaceNeededOnUnrelatedInterfaceList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
|
||
namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType | ||
{ | ||
class InterfaceNeededOnUnrelatedInterfaceList | ||
{ | ||
[Kept] | ||
static Foo s_foo; | ||
|
||
static void Main () | ||
{ | ||
object ob = new Bar (); | ||
((IBar) ob).Frob (); | ||
s_foo = null; | ||
} | ||
|
||
[Kept] | ||
interface IFoo | ||
{ | ||
[Kept] | ||
void Frob (); | ||
} | ||
|
||
[Kept] | ||
[KeptInterface (typeof (IFoo))] | ||
interface IBar : IFoo | ||
{ | ||
} | ||
|
||
[Kept] | ||
class Foo : IBar | ||
{ | ||
void IFoo.Frob () | ||
{ | ||
} | ||
} | ||
|
||
[Kept] | ||
[KeptInterface (typeof (IBar))] | ||
[KeptInterface (typeof (IFoo))] | ||
class Bar : IBar | ||
{ | ||
[Kept] | ||
public Bar () { } | ||
|
||
[Kept] | ||
void IFoo.Frob () | ||
{ | ||
} | ||
} | ||
} | ||
} |