- 
                Notifications
    
You must be signed in to change notification settings  - Fork 7
 
Open
Description
I tried to use a struct from Java/Kotlin code and the mapping of methods seems a bit strange to me. The following test compiles and runs but I would have rather expected static functions here to avoid this dummy instance. It would also be tempting to map structs to real classes with constructors and instance methods but I am not sure whether that would actually be fully compatible with Rust. So, static methods seem to be the safer bet to me at the moment.
    @Test
    fun test_impl() {
        val dummy = NamedCounter()
        val counter = dummy.new("Michael", 99)
        val limit = dummy.get_limit(counter)
        assert(limit == 99L)
// Shouldn't this rather be mapped to static functions like this?
//        val counter = NamedCounter.new("Michael", 99)
//        val limit = NamedCounter.get_limit(counter)
//        assert(limit == 99L)
    }
Metadata
Metadata
Assignees
Labels
No labels