From 3904f02d8155e0ee0cc6003e24a98c1ec79c6d15 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 7 Dec 2012 22:05:27 -0500 Subject: [PATCH] nitg-s: allocate HashSet[MType] for conflicts_graph_cache A covariant cast error is raised by non-buggy engines when a MNullableType object is added into a Set[MType] that is dynamically a HashSet[MClassType]. Instantiate HashSet[MType] instead of HashSet[MClassType] remove the cast error. Signed-off-by: Jean Privat --- src/coloring.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coloring.nit b/src/coloring.nit index 23cc5d1..7cbdda4 100644 --- a/src/coloring.nit +++ b/src/coloring.nit @@ -878,9 +878,9 @@ class LiveEntryColoring private fun add_conflict(mtype: MType, otype: MType) do if mtype == otype then return - if not self.conflicts_graph_cache.has_key(mtype) then self.conflicts_graph_cache[mtype] = new HashSet[MClassType] + if not self.conflicts_graph_cache.has_key(mtype) then self.conflicts_graph_cache[mtype] = new HashSet[MType] self.conflicts_graph_cache[mtype].add(otype) - if not self.conflicts_graph_cache.has_key(otype) then self.conflicts_graph_cache[otype] = new HashSet[MClassType] + if not self.conflicts_graph_cache.has_key(otype) then self.conflicts_graph_cache[otype] = new HashSet[MType] self.conflicts_graph_cache[otype].add(mtype) end private fun conflicts_graph: Map[MType, Set[MType]] do return conflicts_graph_cache.as(not null) -- 1.7.9.5