uninitialised constant APISerializer::FieldRef (NameError)

Bug #493605 reported by James Knight
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
as2api
Fix Committed
Undecided
David Holroyd

Bug Description

Error:
==================
./output/diff/api_serializer.rb:238:in `serialize_link_tag': uninitialized constant APISerializer::FieldRef (NameError)
        from ./output/diff/api_serializer.rb:215:in `serialize_comment_inlines'
        from ./doc_comment.rb:262:in `each_inline'
        from ./doc_comment.rb:261:in `each'
        from ./doc_comment.rb:261:in `each_inline'
        from ./output/diff/api_serializer.rb:210:in `serialize_comment_inlines'
        from ./output/diff/api_serializer.rb:184:in `serialize_description'
        from (eval):3:in `api_description'
        from ./output/xml/xml_formatter.rb:34:in `element'
         ... 56 levels...
        from ./ui/cli.rb:411
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from as2api.rb:1

I've fixed it from a run-the-script point of view by creating an empty FieldRef class which extends MemberRef. But I don't know what the expected behaviour is, so can't actually put anything useful in there. I guess the question is: what ia a FieldRef?

Cheers
James

Revision history for this message
James Knight (james-knight) wrote :

Sorry, to clarify: this is running --api-export, rather than HTML generation

Revision history for this message
David Holroyd (dholroyd) wrote :

There is no 'FieldRef', but I obviously forgot that when writing the API-export code. In fact, it took me a while to work out what was going on with this code, coming back to it after so long.

The deal is, in the general case, that when doc-comments refer to 'MyType#myThingy' we represent this as a MemberRef. I created a special-case subclass of MemberRef called 'MethodRef' to cover the case where the doc-comment uses the syntax 'MyType#myThingy()', with explicit parenthesis indicating that we expect 'myThingy' to be a method only. In the general case, we should take the MemberRef and base the output formatting on the actual class of member_ref.resolved_member (which will either be ASMethod or an ASField).

So this is what I've changed the code to do -- r386 and r387.

Changed in as2api:
assignee: nobody → David Holroyd (dave-badgers-in-foil)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.