New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer values in annotations #148

Closed
ayosec opened this Issue Sep 19, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@ayosec

ayosec commented Sep 19, 2011

I have tried to compile a class with this method:

  $JRubyMethod["name" => ["[]", "get"], "required" => 1]
  def get(context:ThreadContext , arg:IRubyObject):IRubyObject
    getRuntime.newFixnum @buffer.get(int(longValueFromObject(arg)))
  end

But got this error.

If I change the 1 to "1" the file compiles with no errors, but JRuby gives me an error

The equivalent in Java works with no problems (the compiler recognizes the integer and JRuby loads it)

  @JRubyMethod(name = {"[]", "get"}, required = 1)
  public IRubyObject get(ThreadContext context, IRubyObject arg) {
    return getRuntime().newFixnum(buffer.get((int)longValueFromObject(arg)));
  }

I attached the original file to a gist

@baroquebobcat

This comment has been minimized.

Show comment
Hide comment
@baroquebobcat

baroquebobcat Sep 25, 2011

Member

This is because the annotation support does not currently handle numerics.

Member

baroquebobcat commented Sep 25, 2011

This is because the annotation support does not currently handle numerics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment