From 12b4bc79909f10297921f2145efa96c924a7c715 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Fri, 13 Dec 2019 18:11:38 -0500 Subject: [PATCH] Add name mangling rule for '$' Scala uses '$' suffixes in generated classes extensively. --- plugin/src/main/java/ch/jodersky/sbt/jni/javah/Utils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/src/main/java/ch/jodersky/sbt/jni/javah/Utils.java b/plugin/src/main/java/ch/jodersky/sbt/jni/javah/Utils.java index 61e7a96a..6cb63899 100644 --- a/plugin/src/main/java/ch/jodersky/sbt/jni/javah/Utils.java +++ b/plugin/src/main/java/ch/jodersky/sbt/jni/javah/Utils.java @@ -52,6 +52,8 @@ public static String mangleName(String name) { char ch = name.charAt(i); if (ch == '.') { builder.append('_'); + } else if (ch == '$') { + builder.append("__"); } else if (ch == '_') { builder.append("_1"); } else if (ch == ';') {