Optional args that self-reference must resolve #2124

Closed
headius opened this Issue Nov 6, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@headius
Member

headius commented Nov 6, 2014

See https://bugs.ruby-lang.org/issues/9593

The cases in question are in mri/ruby/test_syntax and look basically like this:

def foo(var = var) ...
def foo(var: defined?(var)) ...

...and so on. This will likely require parser changes. I am excluding test_keyword_self_reference and test_optional_self_reference now.

Note that test_keyword_self_reference actually triggers a Java exception inside IR:

TestSyntax#test_keyword_self_reference:
Java::JavaLang::ClassCastException: org.jruby.ir.operands.UndefinedValue cannot be cast to org.jruby.RubyBasicObject
    org.jruby.runtime.callsite.CachingCallSite.getClass(CachingCallSite.java:401)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:125)
    org.jruby.ir.interpreter.Interpreter.processCall(Interpreter.java:360)
    org.jruby.ir.interpreter.Interpreter.interpret(Interpreter.java:595)
    org.jruby.ir.interpreter.Interpreter.INTERPRET_METHOD(Interpreter.java:697)
    org.jruby.internal.runtime.methods.InterpretedIRMethod.call(InterpretedIRMethod.java:116)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:255)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)

@headius headius added parser ir labels Nov 6, 2014

@headius headius added this to the JRuby 9000 milestone Nov 6, 2014

@subbuss

This comment has been minimized.

Show comment
Hide comment
@subbuss

subbuss Nov 7, 2014

Contributor

That seems weird ...

Contributor

subbuss commented Nov 7, 2014

That seems weird ...

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Nov 7, 2014

Member

Ignore the missing parser warning commit. It was meant for #2147.

Member

headius commented Nov 7, 2014

Ignore the missing parser warning commit. It was meant for #2147.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jan 15, 2015

Member

Coming back to this, I don't think it's an IR issue (at least, it's not anymore)...I think it's a parsing issue.

If the RHS in def foo(var = var) parsed properly, as a local variable load, IR should fall in line and compile it just fine.

Member

headius commented Jan 15, 2015

Coming back to this, I don't think it's an IR issue (at least, it's not anymore)...I think it's a parsing issue.

If the RHS in def foo(var = var) parsed properly, as a local variable load, IR should fall in line and compile it just fine.

@headius headius removed this from the JRuby 9.0.0.0 milestone Jan 15, 2015

@headius headius added JRuby 1.7.x JRuby 9000 and removed ir labels Jan 15, 2015

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Jul 15, 2015

Member

I should have commented on this a long time ago but minimal case for this is 'var = var'. Opt arg is unrelated here. This is something I have always considered as a bug in MRI so I never fixed it but perhaps I should...

Member

enebo commented Jul 15, 2015

I should have commented on this a long time ago but minimal case for this is 'var = var'. Opt arg is unrelated here. This is something I have always considered as a bug in MRI so I never fixed it but perhaps I should...

@enebo enebo removed the JRuby 1.7.x label Apr 1, 2016

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Apr 1, 2016

Member

I am removing 1.7 as support item here as I am starting to wind down on very unlikely to ever be fixed issues. This has been fixed a while on 9000. Closing.

Member

enebo commented Apr 1, 2016

I am removing 1.7 as support item here as I am starting to wind down on very unlikely to ever be fixed issues. This has been fixed a while on 9000. Closing.

@enebo enebo closed this Apr 1, 2016

@enebo enebo added this to the JRuby 9.1.0.0 milestone Apr 1, 2016

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