Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 183493

Summary: Parse fails when IfStatement is return
Product: [Technology] DLTK Reporter: Mark Howe <mark.howe>
Component: RubyAssignee: dltk.ruby-inbox <dltk.ruby-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 0.9   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mark Howe CLA 2007-04-21 02:01:33 EDT
The following fails with a ClassCastException in RubyASTBuildVisitor.visitReturnNode. An attempt is made to cast the IfStatement to an expression and add it to the RubyReturnStatement's CallArgumentsList. It looks like you are aware of the problem, as there is a comment in ExpressList to change it to a StatementList or a add a statement to expression converter. I was trying to find a way to make this specific case work but seems like a more global issue. A place in the rails codebase this affects is activerecord/associations/has_one_association.rb.

def m(b)
  unless b
    return false
  end
end
Comment 1 Mikhail Kalugin CLA 2007-04-25 08:45:26 EDT
It seems to be already fixed. Thanks, anyway.
Comment 2 Andrey Platov CLA 2008-05-26 02:43:39 EDT
bulk change: this bug was fixed in DLTK 0.9