@@[target("rust")]

// Frame type string → Java type spelling.
// Used by framec's Java backend for cast/return-type contexts.
// Part of RFC-0035 round 2 — see csharp_map_type.frs.

@@system JavaMapType {
    interface:
        map(t: String): String

    machine:
        $Active {
            map(t: String): String {
                let result = match t.as_str() {
                    "Any" => "Object".to_string(),
                    "str" | "string" | "String" => "String".to_string(),
                    "int" | "i32" | "i64" | "number" => "int".to_string(),
                    "float" | "f64" | "f32" => "double".to_string(),
                    "bool" | "boolean" => "boolean".to_string(),
                    "void" => "void".to_string(),
                    _ => t.clone(),
                };
                @@:(result)
            }
        }
}
