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