yglukhov / jnim

Nim - Java bridge
MIT License
184 stars 13 forks source link

Fixed multiparameter methods call generation #5

Closed vegansk closed 8 years ago

vegansk commented 8 years ago

There was a problem with parameters array generation. Here is the generated code example:

proc setProperty(p: Properties; k: string; v: string): Object =
  var params {.noinit.}: array[2, jvalue]
  toJValue(k, params[0])
  toJValue(v, params[0])
  jniImpl("setProperty", false, false, p, concatStrings(
      methodSignatureForType(string), methodSignatureForType(string)), params,
          type(k))

See params array in toJValue call, it uses zero index forever. This PR fixes it.

yglukhov commented 8 years ago

@vegansk, thanks a lot! I'm really surprised i haven't noticed this bug yet.