Skip to content
  • Jeremy Evans's avatar
    bb93659f
    Fix pp when passed a empty ruby2_keywords-flagged hash as array element (#2966) · bb93659f
    Jeremy Evans authored
    
    
    This causes problems because the hash is passed to a block not
    accepting keywords.  Because the hash is empty and keyword flagged,
    it is removed before calling the block.  This doesn't cause an
    ArgumentError because it is a block and not a lambda.  Just like
    any other block not passed required arguments, arguments not
    passed are set to nil.
    
    Issues like this are a strong reason not to have ruby2_keywords
    by default.
    
    Fixes [Bug #16519]
    
    This backports 28d31ead and
    0ea759ea, but needed to be modified
    for 2.7 as 2.7 will perform empty keyword to positional hash
    conversion for required arguments, which will happen if "v" in the
    seplist method is empty when yielded.
    
    Co-authored-by: default avatarNARUSE, Yui <nurse@users.noreply.github.com>
    bb93659f
    Fix pp when passed a empty ruby2_keywords-flagged hash as array element (#2966)
    Jeremy Evans authored
    
    
    This causes problems because the hash is passed to a block not
    accepting keywords.  Because the hash is empty and keyword flagged,
    it is removed before calling the block.  This doesn't cause an
    ArgumentError because it is a block and not a lambda.  Just like
    any other block not passed required arguments, arguments not
    passed are set to nil.
    
    Issues like this are a strong reason not to have ruby2_keywords
    by default.
    
    Fixes [Bug #16519]
    
    This backports 28d31ead and
    0ea759ea, but needed to be modified
    for 2.7 as 2.7 will perform empty keyword to positional hash
    conversion for required arguments, which will happen if "v" in the
    seplist method is empty when yielded.
    
    Co-authored-by: default avatarNARUSE, Yui <nurse@users.noreply.github.com>
Loading