From 2316cb90375e768e0305fe42443819a614543d20 Mon Sep 17 00:00:00 2001 From: Etienne Kneuss <ekneuss@gmail.com> Date: Wed, 6 May 2015 17:44:58 +0200 Subject: [PATCH] Set/Map should be cases classes so that equality is consistent --- library/lang/Map.scala | 2 +- library/lang/Set.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/lang/Map.scala b/library/lang/Map.scala index 289ca7ad4..bd186b721 100644 --- a/library/lang/Map.scala +++ b/library/lang/Map.scala @@ -12,7 +12,7 @@ object Map { } @ignore -class Map[A, B](val theMap: scala.collection.immutable.Map[A,B]) { +case class Map[A, B](val theMap: scala.collection.immutable.Map[A,B]) { def apply(k: A): B = theMap.apply(k) def ++(b: Map[A, B]): Map[A,B] = new Map (theMap ++ b.theMap) def updated(k: A, v: B): Map[A,B] = new Map(theMap.updated(k, v)) diff --git a/library/lang/Set.scala b/library/lang/Set.scala index af27ec7ae..36c70a837 100644 --- a/library/lang/Set.scala +++ b/library/lang/Set.scala @@ -12,7 +12,7 @@ object Set { } @ignore -class Set[T](val theSet: scala.collection.immutable.Set[T]) { +case class Set[T](val theSet: scala.collection.immutable.Set[T]) { def +(a: T): Set[T] = new Set[T](theSet + a) def ++(a: Set[T]): Set[T] = new Set[T](theSet ++ a.theSet) def -(a: T): Set[T] = new Set[T](theSet - a) -- GitLab