From f381027fcba7f35f0daf932cff234e13b8e739ed Mon Sep 17 00:00:00 2001 From: Jacob Carlborg Date: Sat, 9 Mar 2024 20:37:09 +0100 Subject: [PATCH] API Notes: Make output of instance methods nicer --- dstep/translator/Translator.d | 4 ++-- tests/unit/ApiNotes.d | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dstep/translator/Translator.d b/dstep/translator/Translator.d index d504f6cb..6818edc2 100644 --- a/dstep/translator/Translator.d +++ b/dstep/translator/Translator.d @@ -301,12 +301,12 @@ class Translator auto function_ = Function( cursor: cursor.func, name: declName, - mangledName: cursor.mangling.some + mangledName: none!string, // handle below ); auto declarationResult = translateFunction(this.context, function_); - output.singleLine("extern (C) private static"); + output.singleLine(`extern (C) private static pragma(mangle, "%s")`, cursor.mangling); output.adaptiveSourceNode(declarationResult); output.append(";"); }); diff --git a/tests/unit/ApiNotes.d b/tests/unit/ApiNotes.d index 495490ba..ca941de5 100644 --- a/tests/unit/ApiNotes.d +++ b/tests/unit/ApiNotes.d @@ -244,8 +244,8 @@ struct Bar return __foo(this, __traits(parameters)); } - extern (C) private static - pragma(mangle, "foo") void __foo (Bar bar, int a); + extern (C) private static pragma(mangle, "foo") + void __foo (Bar bar, int a); } D", options, annotatedFile: "Bar.d"); } @@ -274,8 +274,8 @@ struct Bar return __foo(&this, __traits(parameters)); } - extern (C) private static - pragma(mangle, "foo") void __foo (Bar* bar, int a); + extern (C) private static pragma(mangle, "foo") + void __foo (Bar* bar, int a); } D", options, annotatedFile: "Bar.d"); }