diff --git a/makina-compiler/out/artifacts/makina_compiler_jar/makina-compiler.jar b/makina-compiler/out/artifacts/makina_compiler_jar/makina-compiler.jar index 535231b..ff83130 100644 Binary files a/makina-compiler/out/artifacts/makina_compiler_jar/makina-compiler.jar and b/makina-compiler/out/artifacts/makina_compiler_jar/makina-compiler.jar differ diff --git a/makina-compiler/src/xyz/colinholzman/makina/StateConfiguration.kt b/makina-compiler/src/xyz/colinholzman/makina/StateConfiguration.kt index fbb1952..fd059da 100644 --- a/makina-compiler/src/xyz/colinholzman/makina/StateConfiguration.kt +++ b/makina-compiler/src/xyz/colinholzman/makina/StateConfiguration.kt @@ -42,7 +42,7 @@ data class StateConfiguration(val states: Set) { fun List>.groupByIdAndRemoveRedundantHandlers(): Map>> { return groupBy { it.second.id }.mapValues { entry -> val guards = HashSet() - entry.value.filter { guards.add(it.second.guard) } + entry.value.filter { !guards.contains(null) && guards.add(it.second.guard) } } } } diff --git a/makina-compiler/test/xyz/colinholzman/makina/StateConfigurationTest.kt b/makina-compiler/test/xyz/colinholzman/makina/StateConfigurationTest.kt index cfb7de1..c1de8b8 100644 --- a/makina-compiler/test/xyz/colinholzman/makina/StateConfigurationTest.kt +++ b/makina-compiler/test/xyz/colinholzman/makina/StateConfigurationTest.kt @@ -70,8 +70,7 @@ internal class StateConfigurationTest { Pair(s11, Handler.Event("foo")), Pair(s1, Handler.Event("foo", guard = "bar")) ) - expected = mapOf(Pair("foo", listOf(Pair(s111, Handler.Event("foo")), - Pair(s1, Handler.Event("foo", guard = "bar"))))) + expected = mapOf(Pair("foo", listOf(Pair(s111, Handler.Event("foo"))))) assertEquals(expected, handlers.groupByIdAndRemoveRedundantHandlers())