@@ -4,17 +4,23 @@ import dotty.tools.dotc.core.Contexts.Context
4
4
import dotty .tools .dotc .core .Symbols .Symbol
5
5
import dotty .tools .dotc .core .NameOps .stripModuleClassSuffix
6
6
import dotty .tools .dotc .core .Names .Name
7
+ import dotty .tools .dotc .core .Names .termName
7
8
8
9
inline val TermNameHash = 1987 // 300th prime
9
10
inline val TypeNameHash = 1993 // 301st prime
10
11
inline val InlineParamHash = 1997 // 302nd prime
11
12
12
13
extension (sym : Symbol )
13
14
14
- def constructorName (using Context ) =
15
- sym.owner.fullName ++ " ;init;"
16
-
17
- /** Mangle a JVM symbol name in a format better suited for internal uses by sbt. */
18
- def zincMangledName (using Context ): Name =
19
- if (sym.isConstructor) constructorName
20
- else sym.name.stripModuleClassSuffix
15
+ /** Mangle a JVM symbol name in a format better suited for internal uses by sbt.
16
+ * WARNING: output must not be written to TASTy, as it is not a valid TASTy name.
17
+ */
18
+ private [sbt] def zincMangledName (using Context ): Name =
19
+ if sym.isConstructor then
20
+ // TODO: ideally we should avoid unnecessarily caching these Zinc specific
21
+ // names in the global chars array. But we would need to restructure
22
+ // ExtractDependencies caches to avoid expensive `toString` on
23
+ // each member reference.
24
+ termName(sym.owner.fullName.mangledString.replace(" ." , " ;" ).nn ++ " ;init;" )
25
+ else
26
+ sym.name.stripModuleClassSuffix
0 commit comments