From maechler at stat.math.ethz.ch  Fri Jul 21 10:40:44 2017
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Fri, 21 Jul 2017 10:40:44 +0200
Subject: [Rd] [PATCH] Fix missing break
In-Reply-To: <cadf2c7b-e6d7-e8ba-20e6-17f53a0a6197@roswellpark.org>
References: <60035856.27PnXlZqtm@x2>
 <cadf2c7b-e6d7-e8ba-20e6-17f53a0a6197@roswellpark.org>
Message-ID: <22897.48652.879059.602892@stat.math.ethz.ch>

>>>>> Martin Morgan <martin.morgan at roswellpark.org>
>>>>>     on Fri, 21 Jul 2017 03:43:48 -0400 writes:

    > On 07/20/2017 05:02 PM, Steve Grubb wrote:
    >> Hello,
    >> 
    >> There appears to be a break missing in the switch/case for the LISTSXP case.
    >> If this is supposed to fall through, I'd suggest a comment so that others
    >> know its by design.
    >> 
    >> Signed-off-by: Steve Grubb <sgrubb at redhat.com>

    > An example is

    > $ R --vanilla -e "pl = pairlist(1, 2); length(pl) = 1; pl"
    >> pl = pairlist(1, 2); length(pl) = 1; pl
    > Error in length(pl) = 1 :
    > SET_VECTOR_ELT() can only be applied to a 'list', not a 'pairlist'
    > Execution halted

    > fixed in r72936 (R-devel) / 72937 (R-3-4-branch).

    > Martin Morgan

Cool: The two  Martin M*'s  in the R core team have been "running in parallel".

The example which I meant where the missing break was hidden by
an earlier (wrong) errror message is this one:

> al <- formals(ls); length(al) <- 9
Error in length(al) <- 9 : invalid argument

which my extra changes will fix.

--
The other Martin M* - from the R Core Team



[Rd] [PATCH] Fix missing break
Martin Maechler