murarth / ketos

Lisp dialect scripting and extension language for Rust programs
Apache License 2.0
751 stars 45 forks source link

Problem with deriving FromValueRef #27

Open endeav0r opened 7 years ago

endeav0r commented 7 years ago

The following code:

#[derive(Clone, Debug, ForeignValue, FromValueRef, IntoValue)]
struct example {
    test: u64
}

Gives the error:

error[E0244]: wrong number of type arguments: expected 1, found 2
  --> <omitted>
   |
24 | #[derive(Clone, Debug, ForeignValue, FromValueRef, IntoValue)]
   |                  
murarth commented 7 years ago

I'm not able to reproduce the error with the code you've given. Could you paste (or link to a gist) the entire file?

endeav0r commented 7 years ago

I attempted to create a reduced example for this, but was unable to reproduce. This issue does come up in a larger codebase though. If I figure out more, I'll re-open issue/re-report.

endeav0r commented 7 years ago

Ok, the issue comes from having a pub struct, instead of just struct.

This will reproduce the issue:

extern crate ketos;
#[macro_use] extern crate ketos_derive;

#[derive(Clone, Debug, ForeignValue, FromValue, IntoValue)]
pub struct Example {
    test: u64
}

fn main () {

}

I apologize for the confusion earlier.

murarth commented 7 years ago

I'm still not able to duplicate this error. Taking a stab in the dark, I'd guess maybe there's a version difference problem going on. What version of ketos is your crate using? The latest version is 0.9.0.

I'm afraid it's very difficult to help diagnose the underlying cause without being able to see the entire codebase.