Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/rbs/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ def initialize

def initialize_copy(other)
@sources = other.sources.dup
@class_decls = other.class_decls.dup
@class_decls = other.class_decls.transform_values(&:dup)
@interface_decls = other.interface_decls.dup
@type_alias_decls = other.type_alias_decls.dup
@constant_decls = other.constant_decls.dup
@global_decls = other.global_decls.dup
@class_alias_decls = other.class_alias_decls.dup
@normalize_module_name_cache = other.instance_variable_get(:@normalize_module_name_cache).dup
end

def self.from_loader(loader)
Expand Down
5 changes: 5 additions & 0 deletions lib/rbs/environment/class_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ def initialize(name)
@context_decls = []
end

def initialize_copy(other)
@context_decls = other.context_decls.dup
self
end

def <<(context_decl)
context_decls << context_decl
@primary_decl = nil
Expand Down
5 changes: 5 additions & 0 deletions lib/rbs/environment/module_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ def initialize(name)
@context_decls = []
end

def initialize_copy(other)
@context_decls = other.context_decls.dup
self
end

def <<(context_decl)
context_decls << context_decl
self
Expand Down
Loading