Remove '_' segment from symbol of non-associated functions

This commit is contained in:
David Tolnay 2020-04-19 21:40:04 -07:00
parent 4d46c03231
commit 9d8d80bd81
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -2,9 +2,9 @@ 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(),
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)
}