Project

General

Profile

Actions

Bug #19439

closed

Marshal.load doesn't load Regexp instance variables

Added by andrykonchin (Andrew Konchin) almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:112433]

Description

Hello, I've noticed this strange behaviour:

source_object = Regexp.new("a")
source_object.instance_variable_set(:@foo, :bar)

regexp = Marshal.load(Marshal.dump(source_object))
regexp.instance_variables # => []

I would expect instance variables to be loaded

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0