diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs index 5bb191410..644b12a44 100644 --- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs @@ -921,7 +921,7 @@ namespace ICSharpCode.Decompiler.Tests } [Test] - public async Task InterfaceTests([ValueSource(nameof(defaultOptions))] CompilerOptions cscOptions) + public async Task InterfaceTests([ValueSource(nameof(defaultOptionsWithMcs))] CompilerOptions cscOptions) { await RunForLibrary(cscOptions: cscOptions); } diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InterfaceTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InterfaceTests.cs index d53684028..7346b5af9 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InterfaceTests.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/InterfaceTests.cs @@ -130,7 +130,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty } } #endif + // mcs 2.6.4 emits interface-impl rows depth-first and explicit implementations + // ahead of ordinary members. +#if MCS2 && EXPECTED_OUTPUT + public class C : IA, IA2, IB +#else public class C : IA2, IA, IB +#endif { int IA.Property1 { get { @@ -157,14 +163,22 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty remove { } } +#if MCS2 && EXPECTED_OUTPUT + void IA.Method() + { + throw new NotImplementedException(); + } +#endif public int Finalize() { return 0; } +#if !(MCS2 && EXPECTED_OUTPUT) void IA.Method() { throw new NotImplementedException(); } +#endif } internal interface IInterfacesCannotDeclareDtors @@ -172,7 +186,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty int Finalize(); } -#if ROSLYN + // Naming your own nested interface in the base list is a Roslyn-era relaxation + // shared by mcs 5.23; the legacy csc rejects it with CS0146, mcs 2.6.4 with CS0122. +#if ROSLYN || MCS5 private class Issue3230_F : Issue3230_F.IFoo { protected interface IFoo