@@ -4,17 +4,24 @@ 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
8
+ import dotty .tools .dotc .core .NameKinds .QualifiedNameKind
7
9
8
10
inline val TermNameHash = 1987 // 300th prime
9
11
inline val TypeNameHash = 1993 // 301st prime
10
12
inline val InlineParamHash = 1997 // 302nd prime
11
13
12
14
extension (sym : Symbol )
13
15
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