From e5d7122628969bc47fe46be6bcc8ce766efd7568 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Fri, 17 Jul 2026 16:04:31 +0000 Subject: [PATCH] compiler: drop `private` from three module-crossing declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are declared `private` inside their modules but referenced from outside them, so they were never actually private — module-level `private` is not enforced today (#1343), which is the only reason this compiles. Making them public just states what is already true, ahead of turning that enforcement on. - Config.Config (Config.sk): the shared config record, used as a type in ~20 backend modules (optimize, peephole, AsmOutput, compile, ...). - OuterIstToIR.makeOuterIst, AsmOutput.mangle: internal helpers the driver in compile.sk calls from global scope. (PrettyIR has its own private `mangle`; that one is same-module and stays private.) No behavioural change — the compiler rebuilds itself cleanly. Refs #1343. Co-Authored-By: Claude Opus 4.8 (1M context) --- skiplang/compiler/src/AsmOutput.sk | 2 +- skiplang/compiler/src/Config.sk | 2 +- skiplang/compiler/src/OuterIstToIR.sk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skiplang/compiler/src/AsmOutput.sk b/skiplang/compiler/src/AsmOutput.sk index 17f5edb7d6..d4b4838703 100644 --- a/skiplang/compiler/src/AsmOutput.sk +++ b/skiplang/compiler/src/AsmOutput.sk @@ -1136,7 +1136,7 @@ private fun needsQuotes(s: String): Bool { // This needs to be made reversible and deal correctly with name clashes. // See T22100866 -private fun mangle(name: String): String { +fun mangle(name: String): String { i = name.getIter(); String::tabulate(name.length(), _ -> { i.next().fromSome() match { diff --git a/skiplang/compiler/src/Config.sk b/skiplang/compiler/src/Config.sk index 88f7c02df1..a7bdaee7b7 100644 --- a/skiplang/compiler/src/Config.sk +++ b/skiplang/compiler/src/Config.sk @@ -40,7 +40,7 @@ private fun default_lib_name(output: ?String): String { } } -private class Config{ +class Config{ release: Bool, verbose: Bool, debug: Bool, diff --git a/skiplang/compiler/src/OuterIstToIR.sk b/skiplang/compiler/src/OuterIstToIR.sk index 329121bca2..ae2e9ae7f1 100644 --- a/skiplang/compiler/src/OuterIstToIR.sk +++ b/skiplang/compiler/src/OuterIstToIR.sk @@ -4881,7 +4881,7 @@ private const kEmptyMethods: UnorderedMap< SFunctionID, > = UnorderedMap[]; -private fun makeOuterIst(context: mutable SKStore.Context): OuterIst.Program { +fun makeOuterIst(context: mutable SKStore.Context): OuterIst.Program { // run the compiler front end from parsing to type checking typedAst = SkipMain.type_program(context); // OuterIst skeleton is built here, but code is done lazily