@@ -297,8 +297,8 @@ object desugar {
297297 val isCaseClass = mods.is(Case ) && ! mods.is(Module )
298298 val isCaseObject = mods.is(Case ) && mods.is(Module )
299299 val isImplicit = mods.is(Implicit )
300- val isEnum = mods.hasMod[ Mod . Enum ] && ! mods.is(Module )
301- val isEnumCase = mods.hasMod[ Mod . EnumCase ]
300+ val isEnum = mods.isEnumClass && ! mods.is(Module )
301+ def isEnumCase = mods.isEnumCase
302302 val isValueClass = parents.nonEmpty && isAnyVal(parents.head)
303303 // This is not watertight, but `extends AnyVal` will be replaced by `inline` later.
304304
@@ -641,7 +641,7 @@ object desugar {
641641 val moduleName = checkNotReservedName(mdef).asTermName
642642 val impl = mdef.impl
643643 val mods = mdef.mods
644- lazy val isEnumCase = mods.hasMod[ Mod . EnumCase ]
644+ def isEnumCase = mods.isEnumCase
645645 if (mods is Package )
646646 PackageDef (Ident (moduleName), cpy.ModuleDef (mdef)(nme.PACKAGE , impl).withMods(mods &~ Package ) :: Nil )
647647 else if (isEnumCase)
@@ -688,7 +688,7 @@ object desugar {
688688 */
689689 def patDef (pdef : PatDef )(implicit ctx : Context ): Tree = flatTree {
690690 val PatDef (mods, pats, tpt, rhs) = pdef
691- if (mods.hasMod[ Mod . EnumCase ] )
691+ if (mods.isEnumCase )
692692 pats map {
693693 case id : Ident =>
694694 expandSimpleEnumCase(id.name.asTermName, mods,
@@ -810,16 +810,11 @@ object desugar {
810810 * ==>
811811 * def $anonfun(params) = body
812812 * Closure($anonfun)
813- *
814- * If `inlineable` is true, tag $anonfun with an @inline annotation.
815813 */
816- def makeClosure (params : List [ValDef ], body : Tree , tpt : Tree = TypeTree (), isInlineable : Boolean , isImplicit : Boolean )(implicit ctx : Context ) = {
817- var mods = synthetic | Artifact
818- if (isInlineable) mods |= Inline
814+ def makeClosure (params : List [ValDef ], body : Tree , tpt : Tree = TypeTree (), isImplicit : Boolean )(implicit ctx : Context ) =
819815 Block (
820- DefDef (nme.ANON_FUN , Nil , params :: Nil , tpt, body).withMods(mods ),
816+ DefDef (nme.ANON_FUN , Nil , params :: Nil , tpt, body).withMods(synthetic | Artifact ),
821817 Closure (Nil , Ident (nme.ANON_FUN ), if (isImplicit) ImplicitEmptyTree else EmptyTree ))
822- }
823818
824819 /** If `nparams` == 1, expand partial function
825820 *
0 commit comments