From 51b566672de99dbf28bdf708818f5ab2e08d060a Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Sat, 12 Dec 2015 13:39:19 -0500 Subject: [PATCH] lib/core: Make all `Set` cloneable Signed-off-by: Lucas Bajolet --- lib/core/collection/abstract_collection.nit | 3 +++ lib/core/collection/array.nit | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/collection/abstract_collection.nit b/lib/core/collection/abstract_collection.nit index ef10cfa..f77d8f4 100644 --- a/lib/core/collection/abstract_collection.nit +++ b/lib/core/collection/abstract_collection.nit @@ -409,6 +409,7 @@ end # assert s.has(b) == true interface Set[E] super SimpleCollection[E] + super Cloneable redef fun has_only(item) do @@ -471,6 +472,8 @@ interface Set[E] return nhs end + redef fun clone do return union(self) + # Returns a new instance of `Set`. # # Depends on the subclass, mainly used for copy services diff --git a/lib/core/collection/array.nit b/lib/core/collection/array.nit index d196333..df7f5e7 100644 --- a/lib/core/collection/array.nit +++ b/lib/core/collection/array.nit @@ -592,7 +592,6 @@ end # A set implemented with an Array. class ArraySet[E] super Set[E] - super Cloneable # The stored elements. private var array: Array[E] is noinit -- 1.7.9.5