From 1e88c3a67418ea93618e6223b0ea24b464c24c8c Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Sun, 8 Oct 2017 20:38:26 +0200 Subject: [PATCH] Avoid closure creation in hot code --- compiler/src/dotty/tools/dotc/core/Flags.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala index b5f9517250c1..784fd08a9b63 100644 --- a/compiler/src/dotty/tools/dotc/core/Flags.scala +++ b/compiler/src/dotty/tools/dotc/core/Flags.scala @@ -22,7 +22,8 @@ object Flags { else if (that.bits == 0) this else { val tbits = bits & that.bits & KINDFLAGS - assert(tbits != 0, s"illegal flagset combination: $this and $that") + if (tbits == 0) + assert(false, s"illegal flagset combination: $this and $that") FlagSet(tbits | ((this.bits | that.bits) & ~KINDFLAGS)) }