Skip to content

v0.3: Support frozen-string-literal coexistence #19

@miry

Description

@miry

The current version of master returns with next error when use RUBYOPT="--enable=frozen-string-literal".

$ RUBYOPT="--enable=frozen-string-literal" bundle exec ruby examples/adder/adder.rb
/Users/miry/src/wouterken/crystalruby/lib/crystalruby/source_reader.rb:48:in `node_to_s': undefined method `accept' for nil (NoMethodError)

      SyntaxTree::Formatter.format("", node.accept(@visitor))
                                           ^^^^^^^
	from /Users/miry/src/wouterken/crystalruby/lib/crystalruby/source_reader.rb:73:in `extract_args_and_source_from_method'
	from /Users/miry/src/wouterken/crystalruby/lib/crystalruby/adapter.rb:178:in `define_crystalized_method'
	from /Users/miry/src/wouterken/crystalruby/lib/crystalruby/adapter.rb:108:in `method_added'
	from examples/adder/adder.rb:5:in `<module:Adder>'
	from examples/adder/adder.rb:3:in `<main>'

Debugging:

SyntaxTree.search(method_source, :Params).first returns nil

Note: It worked for 0.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions