Re: MooseX::OmniTrigger

[email protected] (Karen Etheridge)
Newsgroups perl.moose
Message-ID <[email protected]>
On Thu, Dec 22, 2011 at 02:36:00PM -0700, Todd Lorenz wrote:
> Hi, Karen, sure. I should say I *suspect* they're bugs based on my 
> expectations of trigger behavior. I should also say they're extremely minor 
> and probably aren't affecting anyone anywhere.
> 
> They're in mooseisms.t. My explanation of #2 is pretty flip -- I didn't 
> figure anyone would ever actually read it. Let me know if it needs 
> translation.

Using:
https://github.com/trlorenz/MooseX-OmniTrigger/blob/master/t/007-mooseisms.t

# POSSIBLE MOOSE BUG #1. DURING A REBLESS, REGULAR TRIGGERS WILL FIRE FOR
# ANY ATTRIBUTES THAT HAVE AN UNDEFINED init_arg AND BEGAN THE REBLESS WITH
# A VALUE.

This sounds suspiciously similar to a fix I made for 2.0009: "When an
object is reblessed, triggers are called on attributes that are set during
the reblessing."  To clarify, triggers were not called for attributes that
were being *added* (initialized, or altered) during the reblessing, as
rebless() allows the supply of additional constructor arguments -- but
possibly this is a red herring and there is no connection.

I've confirmed this behaviour with my own tests, and indeed the attr must
have init_arg=>undef for the trigger to fire during a rebless.  IMHO this
is definitely a bug and should be fixed.

#2 also sounds like a real issue (it is long so I won't repeat it here).

Todd, do you have a Moose commit bit? It would be of significant value if
you were to commit some TODO tests to the Moose repository so these issues
were documented, and/or write them up as separate RT tickets.  (You can
submit your ssh public key via the instructions in
Moose::Manual::Contributing, or hop on irc.perl.org #moose.)



-- 
      "I do not fear computers. I fear the lack of them." - Isaac Asimov
            .             .            .            .             .
Karen Etheridge, [email protected]       GCS C+++$ USL+++$ P+++$ w--- M++
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.