Skip to content

Commit

Permalink
Try a simple revert
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed Oct 25, 2024
1 parent 84dbe69 commit 577844c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> TypeParameterList(string prefix) {
var l = arity switch {
Expand Down
2 changes: 1 addition & 1 deletion Source/DafnyRuntime/DafnyRuntimeSystemModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public static T[] InitNewArray1<T>(T z, BigInteger size0) {
}
}
} // end of namespace Dafny
public static class FuncExtensions {
internal static class FuncExtensions {
public static Func<U, UResult> DowncastClone<T, TResult, U, UResult>(this Func<T, TResult> F, Func<U, T> ArgConv, Func<TResult, UResult> ResConv) {
return arg => ResConv(F(ArgConv(arg)));
}
Expand Down

0 comments on commit 577844c

Please sign in to comment.