From 577844c30c43a1c6278b3d65908baccf9101263f Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Fri, 25 Oct 2024 15:55:31 -0700 Subject: [PATCH] Try a simple revert --- Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs | 8 +------- Source/DafnyRuntime/DafnyRuntimeSystemModule.cs | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs b/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs index 770aeb9a09..c745aa2595 100644 --- a/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs +++ b/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs @@ -185,15 +185,9 @@ protected override void EmitBuiltInDecls(SystemModuleManager systemModuleManager // } // They aren't in any namespace to make them universally accessible. private void EmitFuncExtensions(SystemModuleManager systemModuleManager, ConcreteSyntaxTree wr) { - // An extension for this arity will be provided in the Runtime which has to be linked. - var omitAritiesBefore16 = !Options.IncludeRuntime && Options.SystemModuleTranslationMode is not CommonOptionBag.SystemModuleMode.OmitAllOtherModules; - var name = omitAritiesBefore16 ? "FuncExtensionsAfterArity16" : "FuncExtensions"; - var funcExtensions = wr.NewNamedBlock("public static class " + name); + var funcExtensions = wr.NewNamedBlock("internal static class FuncExtensions"); foreach (var kv in systemModuleManager.ArrowTypeDecls) { int arity = kv.Key; - if (omitAritiesBefore16 && arity <= 16) { - continue; - } List TypeParameterList(string prefix) { var l = arity switch { diff --git a/Source/DafnyRuntime/DafnyRuntimeSystemModule.cs b/Source/DafnyRuntime/DafnyRuntimeSystemModule.cs index 2c19c6eacb..c22f67e95f 100644 --- a/Source/DafnyRuntime/DafnyRuntimeSystemModule.cs +++ b/Source/DafnyRuntime/DafnyRuntimeSystemModule.cs @@ -503,7 +503,7 @@ public static T[] InitNewArray1(T z, BigInteger size0) { } } } // end of namespace Dafny -public static class FuncExtensions { +internal static class FuncExtensions { public static Func DowncastClone(this Func F, Func ArgConv, Func ResConv) { return arg => ResConv(F(ArgConv(arg))); }