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

jrubyc compiled representation breaks but source rb works fine #4621

Closed
stergiom opened this Issue May 23, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@stergiom

stergiom commented May 23, 2017

Environment

The AOT compiled representation of code utilising the dry-auto_inject gem breaks yet works fine when the source rb is used, - gist illustrating the issue

  • Tested with 9.1.7.0 & 9.1.9.0, the issue is present in both cases

Expected Behavior

Same behavior as with the source rb

Actual Behavior

An ArgumentError is thrown

@flash-gordon

This comment has been minimized.

Show comment
Hide comment
@flash-gordon

flash-gordon May 23, 2017

The more concise example:

class A
  def initialize(foo: 1)
  end
end

class B < A
  def initialize(*, **)
    super
  end
end

B.new

Fails with

ArgumentError: unknown keyword:

But

class B < A
  def initialize(*)
    super
  end
end

works fine. This means the problem is in using ** along with *, this should make no difference
so it looks like a minor bug.

@stergiom just remove ** from your constructor and you should be fine.

flash-gordon commented May 23, 2017

The more concise example:

class A
  def initialize(foo: 1)
  end
end

class B < A
  def initialize(*, **)
    super
  end
end

B.new

Fails with

ArgumentError: unknown keyword:

But

class B < A
  def initialize(*)
    super
  end
end

works fine. This means the problem is in using ** along with *, this should make no difference
so it looks like a minor bug.

@stergiom just remove ** from your constructor and you should be fine.

@enebo enebo added this to the JRuby 9.1.13.0 milestone Aug 18, 2017

enebo added a commit that referenced this issue Aug 18, 2017

Fixes #4621. jrubyc compiled representation breaks but source rb work…
…s fine.

yay for object identity instead of a nice equals...

@enebo enebo closed this in 7118975 Aug 18, 2017

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