From 6709827ba535de203e6db3008cf5377da9ba4a96 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 2 Nov 2019 11:56:40 +0100 Subject: [PATCH] Fix build. --- .../TestCases/Pretty/DelegateConstruction.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs index 80998f6fa..86ec9d1cc 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs @@ -392,17 +392,31 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty return () => integerData; } +#if !MCS + // does not compile with mcs... public static Func Issue1773b(object data) { +#if ROSLYN dynamic dynamicData = data; return () => dynamicData.DynamicCall(); +#else + // This is a bug in the old csc: captured dynamic local variables did not have the [DynamicAttribute] + // on the display-class field. + return () => ((dynamic)data).DynamicCall(); +#endif } public static Func Issue1773c(object data) { +#if ROSLYN dynamic dynamicData = data; return () => dynamicData; +#else + return () => (dynamic)data; +#endif } +#endif + #if ROSLYN public static Func Issue1773d((int Integer, string String) data) {