use crate::syntax::namespace::Namespace;
use crate::syntax::ExternFn;

pub fn extern_fn(namespace: &Namespace, efn: &ExternFn) -> String {
    let receiver = match &efn.receiver {
        Some(receiver) => receiver.ident.to_string() + "$",
        None => String::new(),
    };
    format!("{}cxxbridge02${}{}", namespace, receiver, efn.ident)
}

use crate::syntax::namespace::Namespace;
use crate::syntax::ExternFn;

pub fn extern_fn(namespace: &Namespace, efn: &ExternFn) -> String {
    let receiver_type = match &efn.receiver {
        Some(receiver) => receiver.ident.to_string(),
        None => "_".to_string(),
    };
    format!("{}cxxbridge02${}${}", namespace, receiver_type, efn.ident)
}

--- 
+++ 
@@ -2,9 +2,9 @@
 use crate::syntax::ExternFn;
 
 pub fn extern_fn(namespace: &Namespace, efn: &ExternFn) -> String {
-    let receiver_type = match &efn.receiver {
-        Some(receiver) => receiver.ident.to_string(),
-        None => "_".to_string(),
+    let receiver = match &efn.receiver {
+        Some(receiver) => receiver.ident.to_string() + "$",
+        None => String::new(),
     };
-    format!("{}cxxbridge02${}${}", namespace, receiver_type, efn.ident)
+    format!("{}cxxbridge02${}{}", namespace, receiver, efn.ident)
 }
Remove '_' segment from symbol of non-associated functions
